Re: Ceon URI Mapping v4.x
Adding the includes>functions>html_output.php modifications present in CEON v4.5.2 seemed to do the job.
This is a bit strange as edits to that file are not required in v4.5.3 - replaced by observers. All observer/class files are present and correct.
(using PHP 7)
Re: Ceon URI Mapping v4.x
I can confirm that the friendly url is not being generated from the breadcrumbs when the notifier added in 1.55 is used
NOTIFY_SEFU_INTERCEPT
in function zen_href_link
instead of the hard-coded CEON code chunk originally included in the CEON URI mapping distribution for html_output.
So in the hope of interesting people who know what they are talking about, a bit of info on a plate.
The breadcrumb link is called from init_add_crumbs: eg:.
PHP Code:
$breadcrumb->add(HEADER_TITLE_CATALOG, zen_href_link(FILENAME_DEFAULT));
So this goes off to html_output to make the link:
PHP Code:
function zen_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true, $static = false, $use_dir_ws_catalog = true) {
global $request_type, $session_started, $http_domain, $https_domain, $zco_notifier;
$link = null;
$zco_notifier->notify('NOTIFY_SEFU_INTERCEPT', array(), $link, $page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);
if($link !== null) return $link;
Normally $zco_notifier->notify('NOTIFY_SEFU_INTERCEPT'... would send this off to be modified by \includes\classes\observers\auto.ceon_uri_mapping_link_build.php
but the observer is not working for the breadcrumbs. It works for all other links.
I assume that this because init_add_crumbs is happening earlier in the page than this observer has been instantiated, but I am bit vague on how this works/how to prove it/fix it.
Here's the autoload debug from my dev shop, its seems CEON gets started before init_crumbs, so any advice would be appreciated...
Quote:
actionPoint=>0 include('includes/version.php');
actionPoint=>0 include('(path...)/includes/classes/class.base.php');
actionPoint=>0 include('(path...)/includes/classes/class.notifier.php');
actionPoint=>0 $zco_notifier = new notifier();
actionPoint=>0 include('(path...)/includes/classes/class.phpmailer.php');
actionPoint=>0 include('(path...)/includes/classes/boxes.php');
actionPoint=>0 include('(path...)/includes/classes/category_tree.php');
actionPoint=>0 include('(path...)/includes/classes/template_func.php');
actionPoint=>0 include('(path...)/includes/classes/split_page_results.php');
actionPoint=>0 include('(path...)/includes/classes/language.php');
actionPoint=>0 include('(path...)/includes/classes/cache.php');
actionPoint=>0 include('(path...)/includes/classes/sniffer.php');
actionPoint=>0 include('(path...)/includes/classes/shopping_cart.php');
actionPoint=>0 include('(path...)/includes/classes/navigation_history.php');
actionPoint=>0 include('(path...)/includes/classes/currencies.php');
actionPoint=>0 include('(path...)/includes/classes/message_stack.php');
actionPoint=>0 include('(path...)/includes/classes/breadcrumb.php');
actionPoint=>0 include('(path...)/includes/classes/query_cache.php');
actionPoint=>0 $queryCache = new QueryCache();
actionPoint=>0 include('(path...)/includes/classes/class.zcPassword.php');
actionPoint=>0 $zcPassword = new zcPassword();
actionPoint=>0 include('(path...)/includes/classes/class.CeonURIMappingHandler.php');
actionPoint=>0 include('(path...)/includes/classes/observers/class.user_tracking.php');
actionPoint=>10 require('includes/init_includes/init_file_db_names.php');
actionPoint=>10 require('includes/init_includes/init_database.php');
actionPoint=>30 $zc_cache = new cache();
actionPoint=>40 require('includes/init_includes/init_db_config_read.php');
actionPoint=>41 require('includes/init_includes/init_notifier_trace.php');
actionPoint=>41 require('includes/init_includes/init_report_all_errors.php');
actionPoint=>50 $sniffer = new sniffer();
actionPoint=>50 require('includes/init_includes/overrides/init_gzip.php');
actionPoint=>50 require('includes/init_includes/init_sefu.php');
actionPoint=>60 require('includes/init_includes/init_general_funcs.php');
actionPoint=>60 require('includes/init_includes/init_tlds.php');
actionPoint=>70 require('includes/init_includes/init_sessions.php');
actionPoint=>71 require('includes/init_includes/init_notifier_trace.php');
actionPoint=>78 include('(path...)/includes/classes/observers/class.products_options_stock_observer.php');
actionPoint=>78 $posObserver = new products_options_stock_observer();
actionPoint=>80 actionPoint=>90 $currencies = new currencies();
actionPoint=>90 include('(path...)/includes/classes/observers/class.ec_analytics.php');
actionPoint=>90 $ec_analytics = new ec_analytics();
actionPoint=>90 include('(path...)/includes/classes/observers/class.perfmon.php');
actionPoint=>90 $perfmon = new perfmon();
actionPoint=>99 $ceon_uri_mapping = new CeonURIMappingHandler();
actionPoint=>100 $template = new template_func();
actionPoint=>100 require('includes/init_includes/init_sanitize.php');
actionPoint=>100 actionPoint=>110 require('includes/init_includes/init_languages.php');
actionPoint=>110 require('includes/init_includes/init_templates.php');
actionPoint=>115 require('includes/init_includes/init_zca_layout.php');
actionPoint=>120 $_SESSION[navigation]->add_current_page();
actionPoint=>120 require('includes/init_includes/overrides/init_currencies.php');
actionPoint=>130 $messageStack = new messageStack();
actionPoint=>130 require('includes/init_includes/overrides/init_customer_auth.php');
actionPoint=>139 require('includes/init_includes/init_posm_product_valid.php');
actionPoint=>140 require('includes/init_includes/init_cart_handler.php');
actionPoint=>150 require('includes/init_includes/init_special_funcs.php');
actionPoint=>160 $breadcrumb = new breadcrumb();
actionPoint=>160 require('includes/init_includes/init_category_path.php');
actionPoint=>161 require('includes/init_includes/overrides/init_canonical.php');
actionPoint=>170 require('includes/init_includes/overrides/init_add_crumbs.php');
actionPoint=>175 require('includes/init_includes/init_observers.php');
actionPoint=>180 require('includes/init_includes/overrides/init_header.php');
actionPoint=>190 include('(path...)/includes/classes/observers/class.products_viewed_counter.php');
actionPoint=>190 $products_viewed_counter = new products_viewed_counter();
actionPoint=>190 include('(path...)/includes/classes/observers/class.search_log.php');
actionPoint=>190 $search_log = new search_log();
actionPoint=>199 $user_tracking_observe = new user_tracking();
actionPoint=>200 include('(path...)/includes/classes/observers/class.advshipperCheckoutProcess.php');
actionPoint=>200 $advshipper_checkout_process = new advshipperCheckoutProcess();
actionPoint=>200 include('(path...)/includes/classes/observers/class.back_in_stock_notificationsAccount.php');
actionPoint=>200 $back_in_stock_notifications_account = new back_in_stock_notificationsAccount();
actionPoint=>200 include('(path...)/includes/classes/observers/class.back_in_stock_notificationsProductInfo.php');
actionPoint=>200 $back_in_stock_notifications_product_info = new back_in_stock_notificationsProductInfo();
actionPoint=>200 include('(path...)/includes/classes/dynamic_price_updater.php');
actionPoint=>200 include('(path...)/includes/classes/observers/class.emailFor404.php');
actionPoint=>200 $emailFor404 = new emailFor404();
actionPoint=>200 include('(path...)/includes/classes/observers/class.emp_order_observer.php');
actionPoint=>200 $emp_order_observer = new emp_order_observer();
Re: Ceon URI Mapping v4.x
I don't have a copy of the updated Ceon URI up/open to see how the observer is incorporated, but seeing that there is no specific call to the observer, then it loads at point 175 which is after the crumbs ran at 170. So to specifically support the rewrite of the breadcrumbs, the Ceon observer would need to load before the breadcrumb of 170. This would be accomplished by adding an includes/autoloader file to specifically load at least that one observer point prior to 170 (168?).
Re: Ceon URI Mapping v4.x
Great. I swapped around the breakpoints in config.core (init_observers at 170 and init_add_crumbs at 175) and all appears to be working now.
Thanks for the quick response.
PHP Code:
/** STEVE swapped 170 and 175 around to allow breadcrumbs to be handled by observer
* Breakpoint 170.
*
* require('includes/init_includes/init_observers.php');
*
*/
$autoLoadConfig[170][] = array('autoType'=>'init_script',
'loadFile'=> 'init_observers.php');
/**
* Breakpoint 175.
*
* require('includes/init_includes/init_add_crumbs.php');
*
*/
$autoLoadConfig[175][] = array('autoType'=>'init_script',
'loadFile'=> 'init_add_crumbs.php');
Re: Ceon URI Mapping v4.x
Quote:
Originally Posted by
torvista
Great. I swapped around the breakpoints in config.core (init_observers at 170 and init_add_crumbs at 175) and all appears to be working now.
Thanks for the quick response.
PHP Code:
/** STEVE swapped 170 and 175 around to allow breadcrumbs to be handled by observer
* Breakpoint 170.
*
* require('includes/init_includes/init_observers.php');
*
*/
$autoLoadConfig[170][] = array('autoType'=>'init_script',
'loadFile'=> 'init_observers.php');
/**
* Breakpoint 175.
*
* require('includes/init_includes/init_add_crumbs.php');
*
*/
$autoLoadConfig[175][] = array('autoType'=>'init_script',
'loadFile'=> 'init_add_crumbs.php');
That may have shown proof of concept, but is not an ideal solution to what could be corrected with a minor change of the plugin rather than ZC core code.
Please see https://github.com/mc12345678/CEON-U...0c83abf882e64f
Re: Ceon URI Mapping v4.x
mc, thank you for that GitHub fork. All's working fine now.
Re: Ceon URI Mapping v4.x
Quote:
Originally Posted by
simon1066
mc, thank you for that GitHub fork. All's working fine now.
Welcome, though if I didn't know any better it seems Torvista put a lot of effort into making changes supporting the above discovery in the main/parent repository.
Re: Ceon URI Mapping v4.x
Quote:
That may have shown proof of concept, but is not an ideal solution to what could be corrected with a minor change of the plugin rather than ZC core code.
Coming from my corner of semi-php-literate, I am of this line of thinking:
1) breadcrumbs uses the zen_href_link function,
2) zen_href_link has a notifier available...so that notifier should be available for anything that wants to use it.
It doesn't work, because the breadcrumbs code is loaded before the notifier-observer code.
So that notifier (nor any, I imagine) does not work.
That seems like a core bug to me and nothing to do with any external code that may use the notifier...?
Re: Ceon URI Mapping v4.x
Quote:
Originally Posted by
torvista
Coming from my corner of semi-php-literate, I am of this line of thinking:
1) breadcrumbs uses the zen_href_link function,
2) zen_href_link has a notifier available...so that notifier should be available for anything that wants to use it.
It doesn't work, because the breadcrumbs code is loaded before the notifier-observer code.
So that notifier (nor any, I imagine) does not work.
That seems like a core bug to me and nothing to do with any external code that may use the notifier...?
This is the content from the top of includes/init_includes/init_observers.php:
Code:
/**
* auto-load and instantiate all /includes/classes/observers/auto.xxxxxxxxx.php classes
*
* This looks for any files in the DIR_WS_CLASSES/observers folder matching the naming convention of "auto.XXXXXX.php"
* It then automatically "include"s those files.
* And then it checks to see whether the XXXXXXXXX part of the filename matches a class name using "zcObserver" + the CamelCased XXXXXXXXX string.
* ie: zcObserverTemplateFrameworkAbc would match auto.template_framework_abc.php
* If the properly named class exists, then it instantiates that class using an object of the same name. If the class inside the file is NOT properly named, it will NOT be instantiated, despite being loaded.
*
* The assumption is that the class is an observer class which properly extends the base class.
* All normal observer class behavior applies.
*
* This fires at AutoLoader point 175, so all previously-processed system dependencies are in place.
* If you need an observer class to fire at a much earlier point so it fires before other system processes, you'll need to add your own auto_loaders/config.yyyyy.php file with relevant rules to load those observers.
*
It describes how this particular feature of ZC can be used and identifies that if the load point provided doesn't suit the desire operation then to incorporate an alternate means of loading the necessary observer.
Based on the explained logic above that snippet, then one would say that the file should load well before 175 because there are observers throughout the ZC code not just the one that is affected by init_breadcrumbs. It's a sound thought that the fix be to move the load up sooner, but at what cost to the overall process. There are likely those programs that use the auto. style of observer and may actually need it to be at 175 or after the breadcrumbs, modifying the core load sequence to suit the program when the program could be modified to integrate with the core is not the same thing.
Re: Ceon URI Mapping v4.x
Quote:
Originally Posted by
mc12345678
Welcome, though if I didn't know any better it seems Torvista put a lot of effort into making changes supporting the above discovery in the main/parent repository.
Of course, thank you Torvista.