Totally Zenned
- Join Date:
- Feb 2009
- Location:
- UK
- Posts:
- 1,326
- Plugin Contributions:
- 0
Views: 88,602
Totally Zenned
Totally Zenned
<?php include ("ceon_uri_mapping_javascript.php"); ``` > > So avoiding any core file changes. I followed your advice regarding creation of categories_CEON.php and product_CEON.php but have discovered that I no longer have URI Mapping fields when viewing manufactures or ezpages in admin. I created two additional files called manufacturers_CEON.php and ezpages_CEON.php which has resolved that issue, although admin/includes/classes/class.CeonURIMappingAdminManufacturerPages.php appears to need some work as it's using old table layout code. The main issue I am faced with now is that I can't get the URI Mapping field to display when copying a product. I tried creating a category_product_listing_CEON.php file and that made no difference, so I then tried a copy_product_CEON.php file, and that didn't help either. Any suggestions on how to get it to work for product copy? ZC 1.5.7c and URI Mapping v5.1torvista:
Regarding merging to ZC157.
The ZC157 version of admin javascript loader will pull in files per page.
In lieu of a complete rework to use the plugins framework, in admin I moved ceon_uri_mapping_javascript.php to the /javascript folder, and added two files to be auto-included by javascript loader per admin page:
categories_CEON.php
product_CEON.php
both with the same code:
Totally Zenned
Ok, some more info for you based on my findings so far.
In one of my copies of URI Mapping (not sure on version) I have admin/includes/auto_loaders/config.ceon_uri_mapping_admin_javascript_loader.php
This file doesn't exist in a fresh download from ceon.net, so clearly not from version 5.1
I checked the content of this file and it calls observers/class.CeonURIMappingJavaScriptLoader.php which is also not present in version 5.1
Upon checking that file it contains
class zcObserverClassCeonURIMappingJavaScriptLoader extends base
{
public function __construct() {
$observeThis = array();
$observeThis[] = 'NOTIFY_ADMIN_FOOTER_END';
$this->attach($this, $observeThis);
}
public function updateNotifyAdminFooterEnd(&$callingClass, $notifier) {
if (file_exists(DIR_WS_INCLUDES . 'ceon_uri_mapping_javascript.php')) {
require DIR_WS_INCLUDES . 'ceon_uri_mapping_javascript.php';
}
}
}
I copied these additional files into my v5.1 installation, and modified observers/class.CeonURIMappingJavaScriptLoader.php to point to the changed location of ceon_uri_mapping_javascript.php
public function updateNotifyAdminFooterEnd(&$callingClass, $notifier) {
if (file_exists(DIR_WS_INCLUDES . 'javascript/ceon_uri_mapping_javascript.php')) {
require DIR_WS_INCLUDES . 'javascript/ceon_uri_mapping_javascript.php';
}
}
and since doing this the URI Mapping radio buttons are correctly displayed on product copy.
It seems that some issues have crept into the module somewhere along the way between updates.
I'm now working to fix the layout issue on the manufacturers page URI field
Totally Zenned
One side effect of the above changes are that the content in the add/edit manufacturers sidebar is now duplicated. I had hoped that removing my earlier manufacturers_CEON.php file would resolve that issue, but no dice, so clearly there are still some issues here.
Totally Zenned
I seem to have got it working now. I've made multiple edits to resolve the issues I ran into. Not sure on the best way to make them available to you all as there are multiple file edits.
Should I just list them here individually?
Totally Zenned
Thanks for your efforts, I've not had time to get near this at all.
I would just zip up the changed files and post them here, if allowed. You've spent enough time on it.
Totally Zenned
Note that the download from the Ceon site is now 5.1, although not shown as such until it is unzipped.
Further discussions should be based on this.
A Github for this would be preferable for reporting issues, but that is up to Ceon support.
Meanwhile, after implementing this, I found two issues.
With the installUpgrade script, but only with php8 on strict reporting. I didn't investigate further as this will affect few people at this moment.
Ask a question uses GET pid instead of GET products_id
This seems to be half-accounted for with a new observer but still after test-submitting a question
I got:
--> PHP Notice: Undefined index: products_id in .../includes/classes/class.CeonURIMappingHandler.php on line 821.
which is
if (isset($_GET['cPath']) && $_GET['cPath'] == zen_get_product_path($_GET['products_id'])) {
as at this point for AAQ $_GET['products_id'] does not exist, but $_GET['pid'] does.
Strangely on the subsequent line $_GET['products_id'] and $_GET['pid'] are both unset, implying this issue has been considered but maybe this bit slipped through the net.
Anyway just prior to that I added:
//AAQ uses pid
if (!isset($_GET['products_id']) && isset($_GET['pid'])) {
$_GET['products_id'] = $_GET['pid'];
}//eof
and all seems well.
Totally Zenned
torvista:
Note that the download from the Ceon site is now 5.1, although not shown as such until it is unzipped.
Further discussions should be based on this.
It's also worth noting that the fileset from the CEON site appears to get updated without a change in the version number. I have just downloaded their current version, compared it to my last v5.1.0 download and found some file changes dated earlier this month.
Totally Zenned
simon1066:
It's also worth noting that the fileset from the CEON site appears to get updated without a change in the version number. I have just downloaded their current version, compared it to my last v5.1.0 download and found some file changes dated earlier this month.
Worth mentioning that these file changes are fixes for issues raised in this thread.
Totally Zenned
Worth mentioning that these file changes are fixes for issues raised in this thread.
While one can't complain about the cost of the support, a public Github would document this and allow feedback both ways. Everyone on all sides is always very busy, so anything that can avoid repeating time spent on discovering, fixing and documenting these bugs and fixes/filechanges would be to everyones benefit (users and Ceon support) and increase visibility to encourage the purchase of the Mappings Manager...
Totally Zenned
Notice raised by copying a product as duplicate from a product listing.
--> PHP Notice: Undefined index: uri-mapping in ADMIN\includes\classes\class.CeonURIMappingAdminProductPages.php on line 1238 & 1241.
File
// Generate new URI mapping for this new product?
$this->_uri_mapping_autogen = (($_POST['uri-mapping'] == 'autogen') ? true : false);// Copy existing URIs from product being copied? $uri_mapping_copy = (($_POST['uri-mapping'] == 'copy') ? true : false);
Probably only needs isset wrapping...
// Generate new URI mapping for this new product?
$this->_uri_mapping_autogen = isset($_POST['uri-mapping']) && $_POST['uri-mapping'] === 'autogen';// Copy existing URIs from product being copied? $uri_mapping_copy = isset($_POST['uri-mapping']) && $_POST['uri-mapping'] === 'copy';
New Zenner
when will updated for 1.57?
Totally Zenned
persion:
when will updated for 1.57?
Looking back over the last few "pages" of posts it seems to me that the latest version of Ceon URI works with ZC 1.5.7c already. Upon what update are you seeking?
Totally Zenned
torvista:
Notice raised by copying a product as duplicate from a product listing.
File
Probably only needs isset wrapping...
Sorry, wrong post.
Totally Zenned
persion:
when will updated for 1.57?
Works fine for me on 1.5.7
Zen Follower
Put my website live v157 using ceon uri mapping v5.0.0 ... then panic, realised that there was a later version ... so updated to the latest version of ceon v.5.1.0
But Ive got 2 installation errors ...
Found the code to delete in admin/includes/javascript_loader.php ... however deleting this piece of coding means that the place to add your url in on the product page disappears. Is this correct ?
The other error I cant find mention of the code to remove.
Totally Zenned
toyseller:
Put my website live v157 using ceon uri mapping v5.0.0 ... then panic, realised that there was a later version ... so updated to the latest version of ceon v.5.1.0
But Ive got 2 installation errors ...
Found the code to delete in admin/includes/javascript_loader.php ... however deleting this piece of coding means that the place to add your url in on the product page disappears. Is this correct ?
The other error I cant find mention of the code to remove.
To me, looks like haven't completed the upgrade instructions of the docs (going from 5.0.0 to 5.1.0). When looking at the instructions, along the top is an upgrading section/area:
_docs/sections/upgrading.html
Then, based on what is said above, upgrading from 5.0.0 to 5.1.0, would then go to that section/area:
_docs/sections/upgrading.html#upgrading-from-version-5-0-x
Then scroll down a little which will help address the above two issues. Look below the "Updated files for the main site directory" there is a section that looks like is applicable to Zen Cart 1.5.7. It seems to indicate that need to add some files and then further below that is to delete a file (if I understand correctly it appears to say when installing to Zen Cart 1.3.9c and above): includes/extra_datafiles/ceon_uri_mapping_sessions_define.php
that file appears to be one of the files referenced in the previous image...
All that said, though interestingly as I look through the installation portion of the instructions (had this truly been an initial install) then it looks like the step to include the 1.5.7 related file(s) is missing from the instruction. That's a shame for users brand new to using the software on Zen Cart 1.5.7 if initially downloaded from their site.
Zen Follower
Thank you for your reply.
I put my website into live then realised that I didnt have the latest version of this module. So was in a bit of a panic.
(Its the 2nd plugin where I had installed the wrong version, the latest being held outside this forum)
Ive deleted includes/extra_datafiles/ceon_url_mapping_sessions_define.php
I dont know what to do with zcadmin/includes/javascript_loader.php as when I delete the lines it refers to ... I lose the ability to modify my filename in the products admin page. Although the installation warning message goes away.
Surely the whole point of the module is to edit your filenames.
I also have a log error message.
[17-Nov-2021 09:33:52 Europe/London] PHP Fatal error: Call to a member function collectInfoBuildURIMappingForm() on null in /zcadmin/includes/ceon_uri_mapping_javascript.php on line 24
[17-Nov-2021 09:33:52 Europe/London] Request URI: /zcadmin/index.php?cmd=product&page=1&cPath=199&pID=2267&action=new_product, IP address: 2.127.66.203
--> PHP Fatal error: Call to a member function collectInfoBuildURIMappingForm() on null in /zcadmin/includes/ceon_uri_mapping_javascript.php on line 24.
Totally Zenned
toyseller:
Thank you for your reply.
I put my website into live then realised that I didnt have the latest version of this module. So was in a bit of a panic.
(Its the 2nd plugin where I had installed the wrong version, the latest being held outside this forum)Ive deleted includes/extra_datafiles/ceon_url_mapping_sessions_define.php
I dont know what to do with zcadmin/includes/javascript_loader.php as when I delete the lines it refers to ... I lose the ability to modify my filename in the products admin page. Although the installation warning message goes away.
Surely the whole point of the module is to edit your filenames.
I also have a log error message.
[17-Nov-2021 09:33:52 Europe/London] PHP Fatal error: Call to a member function collectInfoBuildURIMappingForm() on null in /admin/includes/ceon_uri_mapping_javascript.php on line 24
[17-Nov-2021 09:33:52 Europe/London] Request URI: /admin/index.php?cmd=product&page=1&cPath=199&pID=2267&action=new_product, IP address: XXX.XXX.XXX.XXX
--> PHP Fatal error: Call to a member function collectInfoBuildURIMappingForm() on null in /admin/includes/ceon_uri_mapping_javascript.php on line 24.
Your lines 23-24 of admin/includes/ceon_uri_mapping_javascript.php are they:
$languages = zen_get_languages();
echo json_encode(utf8_encode($ceon_uri_mapping_admin->collectInfoBuildURIMappingForm())); ?>;
or is there this content inserted between those two lines?:
if (empty($ceon_uri_mapping_admin) || !is_object($ceon_uri_mapping_admin)) {
if (!class_exists('CeonURIMappingAdminProductPages')) {
require_once(DIR_WS_CLASSES . 'class.CeonURIMappingAdminProductPages.php');
}
$ceon_uri_mapping_admin = empty($GLOBALS['ceon_uri_mapping_admin']) ? new CeonURIMappingAdminProductPages() : $GLOBALS['ceon_uri_mapping_admin'];
}
If the second code snippet above is not included in the store's fileset, then the files are not up-to-date with 5.1.0. This file was one of the files that was to be updated for 5.1.0. Further, if that file didn't get updated, then one would question what other files didn't get updated on the server.
Zen Follower
Tell staff why this post should be reviewed.