Yes that's it, thank you. I had searched thoroughly for this (Google and ZC) and nothing came up - if I had only scrolled up a few posts.
Printable View
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.1
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
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.phpCode: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';
}
}
}
and since doing this the URI Mapping radio buttons are correctly displayed on product copy.Code: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';
}
}
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
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.
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?
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.
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.
1) 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.
2) 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
as at this point for AAQ $_GET['products_id'] does not exist, but $_GET['pid'] does.Quote:
if (isset($_GET['cPath']) && $_GET['cPath'] == zen_get_product_path($_GET['products_id'])) {
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:
and all seems well.Quote:
//AAQ uses pid
if (!isset($_GET['products_id']) && isset($_GET['pid'])) {
$_GET['products_id'] = $_GET['pid'];
}//eof
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...Quote:
Worth mentioning that these file changes are fixes for issues raised in this thread.
Notice raised by copying a product as duplicate from a product listing.
FileQuote:
--> PHP Notice: Undefined index: uri-mapping in ADMIN\includes\classes\class.CeonURIMappingAdminProductPages.php on line 1238 & 1241.
Probably only needs isset wrapping...Quote:
// 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);
Quote:
// 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';
when will updated for 1.57?
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.
Attachment 19814
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.
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.
Your lines 23-24 of admin/includes/ceon_uri_mapping_javascript.php are they:
or is there this content inserted between those two lines?:Code:$languages = zen_get_languages();
echo json_encode(utf8_encode($ceon_uri_mapping_admin->collectInfoBuildURIMappingForm())); ?>;
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.Code: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'];
}
I have this piece of coding ...
Attachment 19815
admin/includes/ceon_uri_mapping_javascript.php was probably wrong, but I think I may have gone back and recopied in the v5.1.0 file, before you asked this question.
Now, when I remove the requested lines from admin/includes/javascript_loader.php Im still retaining the ability to change the file name in the admin product page.
I noticed that the error log message hadnt been produced for a couple of hours.
I might just be ok now, with no errors of any kind.
Based on that, then the debug message posed earlier was related to when the code in the version of the file shown in the image was from 5.0.0. Line 24 in the file shown in the image is an empty line.
So, it appears that at this time, the issue remains that the URI box does not appear at the bottom of the edit product page. The statement had been made that code was removed in "fixing" the installation. Was the code, referenced within the upgrade section, added? There are/were two files that were identified as needing to be added for a Zen Cart 1.5.7 system:
Quote:
Installing to Zen Cart 1.5.7
Copy all of the folders and files from the files/zen_cart_version_specific/v1.5.7/admin folder into the store's "admin" directory, whatever it is called.
The files are already in the correct directory structure, so a single drag-and-drop of the folders/files in the files/admin folder into the "admin" directory for the store will put the files in the correct locations.
Please do not copy the files individually - there's simply no need - doing so often results in files being missed out!
- admin/includes/classes/observers/class.CeonURIMappingJavaScriptLoader.php
- admin/includes/auto_loaders/config.ceon_uri_mapping_admin_javascript_loader.php
We are getting a "Deprecated Constructor" error using CEOn URI Mapping 5.1.0 with ZC 1.5.7b
winecountrycannabistours.com
Do you have a fix?
Thank you strelitzia.
It appears the problem may have been an old or corrupted file.
I need help , I tried to integrate this in php 7.4 and zencart 157c , but its not working , saying " too many redirects" . How can I fix that ?
... noting that @simon1066 'beat me to it'.
The processing needs update to handle the zc157 "Ask a Question" page's product-id variable; that page uses pid instead of the more standard products_id. Seeing logs similar to:
Code:[03-Feb-2022 11:23:06 America/Los_Angeles] Request URI: /subsite/index.php?main_page=ask_a_question&pid=242, IP address: 127.0.0.1
#1 CeonURIMappingHandler->_handleZCDynamicURI() called at [/home/mysite/public_html/subsite/includes/classes/class.CeonURIMappingHandlerBase.php:472]
#2 CeonURIMappingHandlerBase->_handleURI() called at [/home/mysite/public_html/subsite/includes/classes/class.CeonURIMappingHandlerBase.php:149]
#3 CeonURIMappingHandlerBase->__construct() called at [/home/mysite/public_html/subsite/includes/classes/class.CeonURIMappingHandler.php:52]
#4 CeonURIMappingHandler->__construct() called at [/home/mysite/public_html/subsite/includes/autoload_func.php:44]
#5 require(/home/mysite/public_html/subsite/includes/autoload_func.php) called at [/home/mysite/public_html/subsite/includes/application_top.php:222]
#6 require(/home/mysite/public_html/subsite/includes/application_top.php) called at [/home/mysite/public_html/subsite/index.php:25]
--> PHP Notice: Undefined index: products_id in /home/mysite/public_html/subsite/includes/classes/class.CeonURIMappingHandler.php on line 459.
Suggest updating the fileset installed as I just downloaded the recent copy from Ceon and looking at line 459 of includes/classes/class.CeonURIMappingHandler.php it shows:
This line doesn't reflect information related to the above message. Even if it were still one line off (seeing as the line number identified in my email was different than what is posted above), that line reads:Code:in_array($_GET['main_page'], $ceon_uri_mapping_product_related_pages)) {
Which also wouldn't cause the reported issue.Code:$associated_db_id = !empty($_GET['products_id']) ? $_GET['products_id'] : (!empty($_GET['pid']) ? $_GET['pid'] : 0);
I was going off the version that's currently available for download in the Zen Cart plugins; the suggested change does the trick.
Is there any chance of getting that most recent version uploaded to the Zen Cart site? I'd prefer not to have to create an account just to download a free plugin.
> Is there any chance of getting that most recent version uploaded to the Zen Cart site? I'd prefer not to have to create an account just to download a free plugin.
Done. I had to remove all the 1.3 files from the zip though; otherwise it would be too large to submit to the plugins.
I realize this is the V5 thread but I didn't expect to get a response from the old thread - I'm struggling to find the fix that I recall being in the V4 thread (got through 63 pages before getting a splitting headache) ....
using version 4 (likely version 4.5.5) and getting an 'undefined constant' warning (searching the v4 thread with that term related to a PHP version issue - 7.2) - I am using PHP7.1 ... myDEBUG follows;
is CEON version 5.0 backward compatible to v155f? ..... if so then I'll upgrade the version to the latest ... if not a link to the fixs would be appreciated.Code:[12-Feb-2022 14:40:20 Australia/Sydney] Request URI: /ADMIN/index.php, IP address: 220.253.66.181
#1 require_once(/home2/dazzler3/treeoflifejewellery.com.au/includes/extra_datafiles/ceon_uri_mapping_product_pages.php) called at [/home2/dazzler3/treeoflifejewellery.com.au/ADMIN/includes/extra_datafiles/ceon_uri_mapping_product_pages.php:16]
#2 require(/home2/dazzler3/treeoflifejewellery.com.au/ADMIN/includes/extra_datafiles/ceon_uri_mapping_product_pages.php) called at [/home2/dazzler3/treeoflifejewellery.com.au/ADMIN/includes/init_includes/init_file_db_names.php:46]
#3 require(/home2/dazzler3/treeoflifejewellery.com.au/ADMIN/includes/init_includes/init_file_db_names.php) called at [/home2/dazzler3/treeoflifejewellery.com.au/includes/autoload_func.php:48]
#4 require(/home2/dazzler3/treeoflifejewellery.com.au/includes/autoload_func.php) called at [/home2/dazzler3/treeoflifejewellery.com.au/ADMIN/includes/application_top.php:171]
#5 require(/home2/dazzler3/treeoflifejewellery.com.au/ADMIN/includes/application_top.php) called at [/home2/dazzler3/treeoflifejewellery.com.au/ADMIN/index.php:10]
PHP Warning: Use of undefined constant FILENAME_PRODUCT_MUSIC_INFO - assumed 'FILENAME_PRODUCT_MUSIC_INFO' (this will throw an Error in a future version of PHP) in /home2/dazzler3/treeoflifejewellery.com.au/includes/extra_datafiles/ceon_uri_mapping_product_pages.php on line 26
cheers,
Mike
Mike, I don't know if /includes/extra_datafiles/ceon_uri_mapping_filenames.php is part of that older distribution, but here's its contents for v5.0
PHP Code:
<?php
/**
* Ceon URI Mapping Product Type Info Page File Name Definitions.
*
* @package ceon_uri_mapping
* @author Conor Kerr <[email protected]>
* @copyright Copyright 2008-2019 Ceon
* @copyright Copyright 2003-2019 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @link http://ceon.net/software/business/zen-cart/uri-mapping
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: ceon_uri_mapping_filenames.php 1027 2012-07-17 20:31:10Z conor $
*/
/**
* Product type info pages which are missing their defines.
*/
if (!defined('FILENAME_DOCUMENT_GENERAL_INFO')) {
define('FILENAME_DOCUMENT_GENERAL_INFO', 'document_general_info');
}
if (!defined('FILENAME_DOCUMENT_PRODUCT_INFO')) {
define('FILENAME_DOCUMENT_PRODUCT_INFO', 'document_product_info');
}
if (!defined('FILENAME_EZPAGES_POPUP')) {
define('FILENAME_EZPAGES_POPUP', 'ezpages_popup');
}
if (!defined('FILENAME_PRODUCT_BOOK_INFO')) {
define('FILENAME_PRODUCT_BOOK_INFO', 'product_book_info');
}
if (!defined('FILENAME_PRODUCT_FREE_SHIPPING_INFO')) {
define('FILENAME_PRODUCT_FREE_SHIPPING_INFO', 'product_free_shipping_info');
}
if (!defined('FILENAME_PRODUCT_MUSIC_INFO')) {
define('FILENAME_PRODUCT_MUSIC_INFO', 'product_music_info');
}
There seem to be quite a few php 8 bugs.
This one: https://www.zen-cart.com/showthread....44#post1377544
And this one: https://www.zen-cart.com/showthread....43#post1377543
Also
Code:[15-Feb-2022 16:40:05 America/Vancouver] Request URI: /, IP address:
#1 products_viewed_counter->should_be_excluded() called at [/usr/home/sites/zen15/www/includes/classes/observers/class.products_viewed_counter.php:17]
#2 products_viewed_counter->__construct() called at [/usr/home/sites/zen15/www/includes/autoload_func.php:44]
#3 require(/usr/home/sites/zen15/www/includes/autoload_func.php) called at [/usr/home/sites/zen15/www/includes/application_top.php:222]
#4 require(/usr/home/sites/zen15/www/includes/application_top.php) called at [/usr/home/sites/zen15/www/index.php:25]
--> PHP Warning: Undefined array key "spider_flag" in /usr/home/sites/zen15/www/includes/classes/observers/class.products_viewed_counter.php on line 37.
[15-Feb-2022 16:40:05 America/Vancouver] Request URI: /, IP address:
#1 define() called at [/usr/home/sites/zen15/www/includes/languages/english/index.php:9]
#2 require_once(/usr/home/sites/zen15/www/includes/languages/english/index.php) called at [/usr/home/sites/zen15/www/includes/modules/require_languages.php:29]
#3 require(/usr/home/sites/zen15/www/includes/modules/require_languages.php) called at [/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php:123]
#4 require(/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php) called at [/usr/home/sites/zen15/www/index.php:35]
--> PHP Warning: Constant TEXT_MAIN already defined in /usr/home/sites/zen15/www/includes/languages/english/index.php on line 9.
[15-Feb-2022 16:40:05 America/Vancouver] Request URI: /, IP address:
#1 define() called at [/usr/home/sites/zen15/www/includes/languages/english/index.php:13]
#2 require_once(/usr/home/sites/zen15/www/includes/languages/english/index.php) called at [/usr/home/sites/zen15/www/includes/modules/require_languages.php:29]
#3 require(/usr/home/sites/zen15/www/includes/modules/require_languages.php) called at [/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php:123]
#4 require(/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php) called at [/usr/home/sites/zen15/www/index.php:35]
--> PHP Warning: Constant TEXT_GREETING_GUEST already defined in /usr/home/sites/zen15/www/includes/languages/english/index.php on line 13.
[15-Feb-2022 16:40:05 America/Vancouver] Request URI: /, IP address:
#1 define() called at [/usr/home/sites/zen15/www/includes/languages/english/index.php:18]
#2 require_once(/usr/home/sites/zen15/www/includes/languages/english/index.php) called at [/usr/home/sites/zen15/www/includes/modules/require_languages.php:29]
#3 require(/usr/home/sites/zen15/www/includes/modules/require_languages.php) called at [/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php:123]
#4 require(/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php) called at [/usr/home/sites/zen15/www/index.php:35]
--> PHP Warning: Constant TEXT_GREETING_PERSONAL already defined in /usr/home/sites/zen15/www/includes/languages/english/index.php on line 18.
[15-Feb-2022 16:40:05 America/Vancouver] Request URI: /, IP address:
#1 define() called at [/usr/home/sites/zen15/www/includes/languages/english/index.php:20]
#2 require_once(/usr/home/sites/zen15/www/includes/languages/english/index.php) called at [/usr/home/sites/zen15/www/includes/modules/require_languages.php:29]
#3 require(/usr/home/sites/zen15/www/includes/modules/require_languages.php) called at [/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php:123]
#4 require(/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php) called at [/usr/home/sites/zen15/www/index.php:35]
--> PHP Warning: Constant TEXT_INFORMATION already defined in /usr/home/sites/zen15/www/includes/languages/english/index.php on line 20.
[15-Feb-2022 16:40:05 America/Vancouver] Request URI: /, IP address:
#1 define() called at [/usr/home/sites/zen15/www/includes/languages/english/index.php:49]
#2 require_once(/usr/home/sites/zen15/www/includes/languages/english/index.php) called at [/usr/home/sites/zen15/www/includes/modules/require_languages.php:29]
#3 require(/usr/home/sites/zen15/www/includes/modules/require_languages.php) called at [/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php:123]
#4 require(/usr/home/sites/zen15/www/includes/modules/pages/index/header_php.php) called at [/usr/home/sites/zen15/www/index.php:35]
--> PHP Warning: Constant HEADING_TITLE already defined in /usr/home/sites/zen15/www/includes/languages/english/index.php on line 49.
These are unrelated to this module and are otherwise (likely) addressed at least in Github on the Zen Cart v157 branch.
many thanks for the response Cindy :smile:
many thanks for the response mc12345678 - will upgrade to v5.1.0
Is there a GitHub for this module? I've got edits that fix duplicated content on admin manufacturers edit, manufacturers new and copy product, plus styling fixes for the manufacturers page content as the current download of the module uses old table layouts on this page.
Contact CEON support via the website.
v1.5.7b Ceon v 5.0.0
Hi, looking for some assistance with this error and others associated with order history/ email functions being thrown continually almost by the minute all with the same
PHP warning [--> PHP Warning: Use of undefined constant ENABLE_SSL - assumed 'ENABLE_SSL' (this will throw an Error in a future version of PHP) in /home2/accountname/public_html/admin/includes/classes/observers/class.CeonURIMappingLinkBuildAdmin.php on line 46.] - observers/class.CeonURIMappingLinkBuildAdmin.php is also pasted below.
... line 46 shows [if (ENABLE_SSL == 'true') { ] ....not sure if that needs to be changed to 'false' and what the implications may be?? Admin and Store configure files settings are set with HTTP server being HTTPS
cheers, Mike
admin/includes/classes/observers/class.CeonURIMappingLinkBuildAdmin.phpCode:[02-Jun-2022 17:01:19 Australia/Sydney] Request URI: /admin/index.php?cmd=orders&origin=index&page=1&oID=812&action=edit, IP address: 120.88.144.143
#1 CeonURIMappingLinkBuildAdmin->updateNotifySEFUInterceptAdmcathref() called at [/home2/account name/public_html/includes/classes/class.base.php:118]
#2 base->notify() called at [/home2/accountname/public_html/admin/includes/functions/html_output.php:71]
#3 zen_catalog_href_link() called at [/home2/accountname/public_html/includes/languages/english/modules/payment/paypalwpp.php:19]
#4 require(/home2/accountname/public_html/includes/languages/english/modules/payment/paypalwpp.php) called at [/home2/accountname/public_html/admin/orders.php:520]
#5 require(/home2/accountname/public_html/admin/orders.php) called at [/home2/accountname/public_html/admin/index.php:11]
--> PHP Warning: Use of undefined constant ENABLE_SSL - assumed 'ENABLE_SSL' (this will throw an Error in a future version of PHP) in /home2/accountname/public_html/admin/includes/classes/observers/class.CeonURIMappingLinkBuildAdmin.php on line 46.
Code:<?php
/**
* Observer for Ceon URI Mapping link creation for admin-generated emails, BISN etc.
* Watches html_output.php function zen_href_catalog_link
*
* @package ceon_uri_mapping
* @author Conor Kerr <[email protected]>
* @author torvista
* @copyright Copyright 2008-2019 Ceon
* @copyright Copyright 2003-2007 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @link https://ceon.net
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version 2016
*/
class CeonURIMappingLinkBuildAdmin extends base
{
public function __construct()
{
$this->attach($this, array('NOTIFY_SEFU_INTERCEPT_ADMCATHREF'));
}
public function updateNotifySEFUInterceptAdmcathref(&$callingClass, $notifier, $p1, &$link, $page, $parameters, $connection)//can use "update" or camelized notifier name. & required for &$link to modify it inside here
{
if (!isset($link) && !isset($page) && !isset($parameters) && !isset($connection) && !isset($_SESSION['NotifySEFUInterceptAdmcathref'])) {
trigger_error('System not updated to handle editable notifier parameters. Need to properly update the operating system. This message will not be repeated for this session.', E_USER_WARNING);
$_SESSION['NotifySEFUInterceptAdmcathref'] = false;
}
if (!defined('CEON_URI_MAPPING_ENABLED') || CEON_URI_MAPPING_ENABLED != 1 || isset($_SESSION['NotifySEFUInterceptAdmcathref'])) {
return;
}
static $ceon_uri_mapping_href_link_builder;
if (!isset($ceon_uri_mapping_href_link_builder)) {
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.CeonURIMappingHREFLinkBuilder.php');
$ceon_uri_mapping_href_link_builder = new CeonURIMappingHREFLinkBuilder();
}
if ($connection == 'NONSSL') {
$link = HTTP_SERVER;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL == 'true') {
$link = HTTPS_SERVER;
} else {
$link = HTTP_SERVER;
}
}
if ($ceon_uri_mapping_href_link_builder->buildHREFLink($link, $page, $parameters, $connection, false)) {
$link = $ceon_uri_mapping_href_link_builder->getHREFLink();
} else {
$link = null;
}
}
public function update(&$callingClass, $notifier, $p1, &$link = null, $page = null, $parameters = null, $connection = null)//can use "update" or camelized notifier name. & required for &$link to modify it inside here
{
if (!isset($link) && !isset($page) && !isset($parameters) && !isset($connection) && !isset($_SESSION['NotifySEFUInterceptAdmcathref'])) {
trigger_error('System not updated to handle editable notifier parameters. Need to properly update the operating system. This message will not be repeated for this session.', E_USER_WARNING);
$_SESSION['NotifySEFUInterceptAdmcathref'] = false;
}
if (!isset($_SESSION['NotifySEFUInterceptAdmcathref'])) {
$this->updateNotifySEFUInterceptAdmcathref($callingClass, $notifier, $p1, $link, $page, $parameters, $connection);
}
}
}
You do not have the latest version of the files.
The block with the error is now this
PHP Code:
if ($connection == 'NONSSL') {
$link = defined('HTTP_CATALOG_SERVER') ? HTTP_CATALOG_SERVER : HTTP_SERVER;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL_CATALOG == 'true') {
$link = defined('HTTPS_CATALOG_SERVER') ? HTTPS_CATALOG_SERVER : (defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER);
} else {
$link = defined('HTTP_CATALOG_SERVER') ? HTTP_CATALOG_SERVER : HTTP_SERVER;
}
}
v1.5.7d ceon v5
I have recently built a new 1.5.7d site (treeoflifejewellery/newstore/dotcom) in a folder in the root of an existing v1.5.5f site (treeoflifejewellery.dotcom) - the intention is to develop that 1.5.7d and then change the website to that version.
The issue i'm having is that on the newly built site (treeoflifejewellery/newstore/dotcom) when I try to navigate to a product or a category it is taking me back the the existing site (treeoflifejewellery.dotcom). If I disable Ceon then navigation within the new site is fine.
The root has an access file with the Ceon rewrite instructions - to that I had to add RewriteCond %{REQUEST_URI} !^/newstore/ [NC] for the home page of newstore to open (otherwise a 404). If I add a .htaccess file to the newstore folder with the rewrite rules specific to that site (from the installation check page in Ceon) (and no other content) I get the existing site (treeoflifejewellery.dotcom) home page open and not newstore.
I assume the redirect issue will disappear when I replace the 'old' site with the new one as there won't be any conflicts however I would really like to prove the site first
So I am definitely missing something but not sure what it is - any help would be appreciated.
cheers, Mike
Totally NOT a fan of "friendly" urls but, I would imagine it is looking at your two sites as one.
Create a folder in your home directory called _test and put the site there. If you have cPanel, you can find instructions at https://myzencarthost.com/index.php?...th-cPanel.html
That way, the "friendlies" will not get confused and the SEs will not ding you for duplicate product.
Well, there are those that I think will get at least a little chuckle out of *ME* saying this, but the above certainly is confusing. :)
Couple of thoughts to put together:
Your test site is a direct descendant of your live site.
Your live site has a set of rules that says, if the requested path matches (agrees with or doesn't agree with) the specific entries, then basically access the main site.
The module is effectively database driven. By copying the existing database to your test site, every existing link in that database is going to try to drive to the domain name of the site and whatever sub-directory associated with the database entry.
The instruction associated with the rules generated by the module indicate that those rules are for the root directory of the domain. It also basically says that there are multiple ways to obtain the desired end result.
The ideal method of "copying" an existing site to using this module is to establish a sub-domain (mytestsite.DOMAINNAME) that has the same sub-directory layout as your existing site. This is regardless of where that sub-site truly exists in relation to the main domain name.
So, you have a couple of options and a couple of paths to take.
My suggestion, besides placing this test site in maintenance mode, is to:
1) modify the original domain .htaccess file so that the existing rules will omit using/referencing your sub-directory path.
2) add the rules generated by the module *AFTER* your existing CEON URI rules.
3) Ensure that you *do not* have an .htaccess in the root of your test site (e.g. remove the .htaccess that was described in the above post).
4) BECAUSE THIS TEST SITE IS FOR VALIDATION PURPOSES AND IS NOT BEING USED TO CREATE NEW DATABASE RECORDS, update the database of your test site to concatenate the sub-directory path to the existing rewritten URI (meaning add the sub-directory path to the front) so that all of the URIs in the test site database point to some "tree" of your test site.
Doing the above, would support your test site links point to/reference the "test site" and the pages referenced from there.
Ideally, a sub-domain would be generated/used (updating the includes/configure.php and admin/includes/configure.php files). If that sub-domain was still in the above sub-directories, then your live site would have to redirect operation to the sub-domain directory via rules *before* your existing CEON URI rules, and then the generated CEON URI rules (after applying the sub-domain) would be placed within the sub-directory/root of that test site and the CEON URIs would not need to be modified... E.g. Less steps, but same/similar result.
After your test store has 1) received a copy of your live store database, and 2) been updated via zc_install, then
Within admin->Tools->Install SQL Patches
Do this once and only once *ASSUMING* you have not *yet* generated any links from within your test store.... If you have, then the above query would need to be modified to exclude the existence of any uri that begins with '/newstore/dotcom'....Code:UPDATE ceon_uri_mapping SET uri = CONCAT('/newstore/dotcom', uri);
We use CEON as well. When we upgrade, we develop the new site in a test domain, for example 157.mydomain.com. CEON stores relative URIs, so the different domain name doesn't cause a problem.
@dbltoe , @mc12345678 @ChuckPhillips
Thank you all for your input/advice - I think the upshot is that I will in future use the sub-domain method for building a test site. So the status is that the new 157d site is working great.
new query
I am however not able to resolve this issue, if indeed it is really an issue at all, in the Installation Check; I get the following warning;
I cannot relate the info above to the file copy in my install - should I just ignore the warning?HTML Code:Modified Core Files Check
A file has had a modification made to it, for an older version of Ceon URI Mapping, but this modification is no longer needed.
The path to the file is /home/myaccount/treeoflifejewellery.com/includes/extra_datafiles/ceon_uri_mapping_sessions_define.php
Although the file had to be modified for a previous version of the module, this version works differently and the file is not modified for this version.
Remove the modification from the file by editing the file and removing the block beginning with // BEGIN CEON URI MAPPING 1 of 1 and ending with // END CEON URI MAPPING 1 of 1 - including those two “marker comments”.
Alternatively, if the file was modified only for Ceon URI Mapping and not for any other module, back up the file (e.g. copy it to your local computer) and replace it with a “fresh” version of the file from a “fresh” set of Zen Cart files.
Code:<?php
/**
* Ceon URI Mapping Sessions cookie location Define.
*
* @package ceon_uri_mapping
* @author Conor Kerr <[email protected]>
* @copyright Copyright 2008-2019 Ceon
* @copyright Copyright 2003-2007 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @link http://ceon.net/software/business/zen-cart/uri-mapping
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: ceon_uri_mapping_sessions_define.php 1027 2019-05-10 for conor: Ceon Support added v5.0.0$
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// Used to force the path for sessions to be at the root.
// Static URIs are relative to the site's root, so cookie should be set for the root
// This removes the need to override the file includes/init_includes/init_sessions.php and means
// that the file includes/init_includes/overrides/init_sessions.php is not necessary.
// Override removal is applicable to the file structure used by ZC 1.3.9c and more recent.
// This is used with consideration that it is the only such use of CUSTOM_COOKIE_PATH.
// If another application defines CUSTOM_COOKIE_PATH to something else before the below define
// then this define will be of no value.
define('CUSTOM_COOKIE_PATH', '/');
It's always worth searching the thread for previous answers and reading the plugin documentation. Searching for 'ceon_uri_mapping_sessions_define.php' I found this post,
https://www.zen-cart.com/showthread....26#post1384926
Hello,
I wanted an info on the module, does the free plug-in already work alone without the URI Mapping Manager or does it necessarily need the Manager module to make it work? Thank you
Thanks for the info,
reading the faq for installation and configuration, I have not seen changes for the htaccess file, and it is not present in the plug-in files,
is it generated automatically or are there very specific rules to put?
Thank you
Yes, the htaccess is generated for you. The docs call it an 'Example rewrite rule' but I found that it worked without needing to make any changes to it. Here's the relevant part from the Docs
Attachment 20097
We have installed the paid version of this module, we are having issues with it, we carry roughly 35000 products, Categories and Sub Categories, it will only change URI's
only on top Cats, we have sent you emails on this issue we would like to resolve, we also tried Sub Cats on there own, same issue.
I'm setting up Zen Cart 1.5.8 (recently released) which is not supported by this module yet, but thought I'd report on something and see what the feedback is. It seems between 1.5.7 and 1.5.8 a new constant TOPMOST_CATEGORY_PARENT_ID was introduced, used in zen_get_parent_categories() in functions_categories.php. This is used from this addon during _handleStaticURI -> zen_get_product_path -> zen_get_parent_categories. The problem out of the box is that the constant is not defined because the Ceon autoload breakpoint for CeonURIMappingHandler instantiation is 95, but this symbol won't be defined until init_category_path at breakpoint 160.
Trying to work around by moving CeonURIMappingHandler instantiation to 161 fails because init_sanitize at breakpoint 96 sets $_GET['main_page'] to 'index' which then screws up its detection of index page navigation and causes an infinite redirect loop.
A dirty hack is to set this missing constant in the CeonURIMappingHandler constructor:
Code:public function __construct()
{
if (!defined('TOPMOST_CATEGORY_PARENT_ID')) {
define('TOPMOST_CATEGORY_PARENT_ID', 0);
}
parent::__construct();
}
https://github.com/zencart/zencart/issues/4939
I also did if (!defined
I have this mod working in production with ZC158, but since I have the UMM version, I can't make my changes public.
I invested a lot of time keeping this mod alive in the interim between Conors passing and CEON support being reactivated. I'm not doing that again.
CEON support needs to clarify the support plan for the free mod.
Hi Scott,
Apologoes this has taken a while to get round to. I've been busy of late as I've recently taken over JSWeb.
Anyway, here's the GitHub link for CEON URI MAPPING
https://github.com/JSWebSteve/Ceon-URI-Mapping-V5.1.0
@Strelitzia
I have forked your repository and pushed my changes for ZC158/php8.2 to my fork.
Can I ask, @torvista or anyone here, what you do about EZ pages, if anything? I just ran into ezpage URLs not working in my 1.5.8 upgrade, I traced it to the fact that URIMappingHandler basically sets $_GET['id'] = (int)$associated_db_id, and later sanitize.php checks with a strict ctype_digit test, so an integer value in $_GET['id'] is discarded, and the ez page header.php gets an empty $ezpage_id and panic redirects to the home page.
This change seems to have come in from lat9 pull #4954 here 4 months ago https://github.com/zencart/zencart/p...9eb3e460775e64
Your fork doesn't appear to address this issue. I'm guessing you don't use EZ pages :) My Mickey Mouse fix is to hack the URIMappingHandler to set $_GET values to strings instead of integers, i.e.: $_GET['id'] = "$associated_db_id";
Quote:
I'm guessing you don't use EZ pages
Correct. Sorry.
There is also the following known issue with ez pages in the released version of Zen Cart 1.5.8: https://www.zen-cart.com/showthread....72#post1390772
Why the core code was changed to necessitate the values to be a string in order to validate that the string is made of numbers seems silly to me. Instead of removing the cast to an integer, why not then cast it to a string?
@strelitzia Hi, are you a Ceon support rep, and is this the official Ceon URI Mapping repo, and can we issue Pull Requests? Or if not there, then where? The repo doesn't seem to be forked from anywhere, but also the files don't have much history so it seems to have been borrowed rather than formally developed. It would be nice to be able to feed useful code fixes back to the addon.
First, I'd like to see a little discussion as @mc12345678 mentioned, why the init_sanitize code works the way it does. I presume the logic behind using ctype_digit() is that a $_GET parameter _ought_ to have come in via a query parameter, which _ought_ to only be able to be text, so any non-string data _probably_ is a hack, but this seems rather tenuous logic and I don't know of any spec that defines what data type $_GET parameters may be. It is amusing that products_id is not sanitised (it's not in the array of fields to check), so URIMappingHandler can set $_GET['products_id'] = 123 without problems, which is possibly why this 'bug/feature' hasn't been noticed before since it doesn't affect product pages.
> First, I'd like to see a little discussion as @mc12345678 mentioned, why the init_sanitize code works the way it does.
Please open an issue on Github.
https://github.com/zencart/zencart
The parameter products_id is not strictly an integer because many, many years ago, it was determined that the products_id would be used to support carrying the attribute information related to the product.
Not everyone uses attributes in every store, so yes, it may in part be possible that a store could operate with such integer sanitization. But, the broader use of the field is numerical and whatever character(s) result from hashing the attributes separated by a colon.
In a way that hashing can be useful to recreate the product, though nearly falls apart when the product has an attribute allowing user provided text.
Fair point, thanks. https://github.com/zencart/zencart/issues/5366
Ah yes good point, you've set off a nasty tic in my left eye, remembering the get_prid() function and how the cart links back to the product page to 'edit' the product, and how I tried to reverse engineer how this stuff works from code with little documentation :) Now I look again, init_sanitize does check products_id with more complicated preg_match logic allowing the colon-separated format and /\d/ regex which, I just checked, an integer PHP variable does test OK with, as does a string type variable, so the ceon addon can put an integer type into $_GET['products_id'] without error. Anyway I'll comment on the github issue I raised.
Handling changed/old/outdated URLS?
After updating some urls with a new format or names etc., how does the old url get handled?
I see a lot of requests from search engines that end in page not found as it is a historical url.
When working properly, CEON will automatically 301 redirect old URIs to the new URIs.
That's what I feared...I have to understand how this bit is supposed to work...ugh.Quote:
When working properly, CEON will automatically 301 redirect old URIs to the new URIs
The old, recognized URI is attempted against the database where it is identified as not being the current, active URI. The associated dynamic data is returned and then the active version of the URI with that data is sought. If not found (in either case) it is expected that the URI is identified as not found (404).
If a matching new address is found then a redirect occurs to identify that the provided URI has changed. This happens for any and all of addresses that remain in the database marked as old (not current).
Attempting to add a new manufacturer doubles up the content of the sidebar so that the core fields (manufacturer name, image, etc.) are prompted twice.
This is a defect in includes/ceon_uri_mapping_javascript.php l.150-187, I'm just not sure of the fix yet.
Yes... I noticed this some weeks ago. Both sets of fields need in-filling for it to parse the data to the dbase.
I don't have this issue, I imagine I fixed it long ago.
Review my fork
**UPDATED URL***
https://github.com/torvista/Ceon-URI-Mapping-V5.1.0/
Steve, yours works, thank you.
You are missing some fixes, I will PR to your repo.
I'm setting Steve's fork as the Github repo since it seems to be the most up to date.
I had hoped to offload/not gain more imagined responsibility....I'd prefer if PRs went to the jsweb repository unless that gathers dust.
You're right; updated.
https://github.com/JSWebSteve/Ceon-URI-Mapping-V5.1.0 is the new Github repo. Thanks to both of you for your hard work.
No, I'm not affiliated with Ceon in any way. I'm a long time developer for, and now owner of JSWeb. We had a long history of working with Conor many years ago.
The github repo is simply the last working version that is being used on client websites with it being updated as and when issues were identified.
I sent several support requests to Ceon.net when they released version 5.0, but never got any response, so started to fix issues myself. It appears there are several different developers applying fixes to v5.x, namely myself, @swguy, and @torvista.
I'm not sure if the current repo contains all those edits after the last PR's were made.
OK many thanks. I had a few messages back and forth with Connor, when he was about to go into hospital. It seems we've resolved the issue I raised by a core Zen Cart change (the handling of 'id' as an int for ezpages) so UriMappingHandler didn't need to be changed, but I'll try to bear this in mind if anything else comes up in future. I've also had to fork two other small repos in my move to PHP 8 as the original owners became unresponsive, c'est la vie.
I have noticed that with 1.5.7, the category URL rewrite fields (checkbox for auto create and new URL) don't seem to appear when editing a category. The file
admin/includes/javascript/ceon_uri_mapping_javascript.php
doesn't seem to be pulled in the way it is for products. Creating the file admin/includes/javascript/categories_CEONUriMapping.php won't work because then add the product edit fields will appear. So I hardcoded inclusion of includes/javascript/ceon_uri_mapping_javascript.php in admin/categories.php.
Any thoughts @strelitzia ?
I have
ceon_uri_mapping_javascript.php
with the code.
then
categories_CEONUriMapping.php
product_CEONUriMapping.php
which both contain
which is working for me.PHP Code:
<?php
include ("ceon_uri_mapping_javascript.php");
I could have *sworn* I tried that and got unwanted fields, but you're right - that works like a charm.
... but it's not in @strelitzia's copy of the code.
How do you go about updating a UMM copy of Ceon? It's not clear to me that ceon.net is still operating.
I usually get a reply when I query something.
OK I'll try again.
I've experienced issues with URI Mapping on ZC 1.5.8
EZ-pages rewrites don't work correctly. Although the correct url is applied to the link in the header, when clicked it simply reloads the admin page.
Tried again using a fresh install of 1.5.8 and URI 5.1.0 to ensure it wasn't caused by some other edits, but the same issue.
Can anyone else confirm this?
@swguy Are you aware of any changes in 1.5.8 that would impact on URI Mapping functionality?
That'll teach me to not read the thread fully. I see it was reported by neekfenwick a while ago on https://github.com/zencart/zencart/issues/5366 and a solution was provided by lat9.
There is an XSS vulnerability in this. Patch below.
manufacturers_id one is definitely exploitable, other ones I added to be safe, not sure if they are sanitized elsewhere.
Code:+++ new/includes/classes/class.CeonURIMappingHandler.php 2023-05-25 12:26:02.822504000 -0700
@@ -408,7 +408,7 @@
// A product review's page needs the ID included as part of the canonical URI
if (defined('FILENAME_PRODUCT_REVIEWS_INFO') && $main_page == FILENAME_PRODUCT_REVIEWS_INFO &&
isset($_GET['reviews_id'])) {
- $ceon_uri_mapping_canonical_uri .= '?reviews_id=' . $_GET['reviews_id'];
+ $ceon_uri_mapping_canonical_uri .= '?reviews_id=' . (int)$_GET['reviews_id'];
}
if (isset($GLOBALS['zco_notifier'])) {
$GLOBALS['zco_notifier']->notify('CEON_CLASS_HANDLER_HANDLE_STATIC_URI_END', compact('mapping_info', 'uri_to_match'));
@@ -689,11 +689,13 @@
global $ceon_uri_mapping_canonical_uri;
$ceon_uri_mapping_canonical_uri = HTTP_SERVER . DIR_WS_CATALOG .
- 'index.php?main_page=index&manufacturers_id=' . $_GET['manufacturers_id'];
+ 'index.php?main_page=index&manufacturers_id=' . (int)$_GET['manufacturers_id'];
} else if (isset($_GET['typefilter']) && $_GET['typefilter'] != '' &&
isset($_GET[$_GET['typefilter'] . '_id']) && $_GET[$_GET['typefilter'] . '_id'] != '') {
global $ceon_uri_mapping_canonical_uri;
+
+ $_GET['typefilter'] = htmlspecialchars($_GET['typefilter']);
$ceon_uri_mapping_canonical_uri = HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=index' .
'&typefilter=' . $_GET['typefilter'] . '&' . $_GET['typefilter'] . '_id=' .
Would someone please PR to https://github.com/JSWebSteve/Ceon-URI-Mapping-V5.1.0
ok, done