Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
menu_breadcrumb sets drupal_set_breadcrumb within hook_init. uc_catalog fires drupal_set_breadcrumb at hook_nodeapi. Altering the module weight for menu_breadcrumb has no effect, because hook_init always fires before hand. This patch sets the breadcrumb at the last possible level, before node view, to give it the capacity to be the last/heaviest (highest precedence) influence on the breadcrumb.
Comment | File | Size | Author |
---|---|---|---|
breadcrumb_respect_weight.patch | 627 bytes | iankp |
Comments
Comment #1
iankp CreditAttribution: iankp commentedComment #2
iankp CreditAttribution: iankp commentedReading other tickets I noticed that logic in hook_init() seemed to be a source of other problems and thought perhaps my patch could be a fix for other issues. My change simply defers breadcrumb generation (more specifically, output) to a place that will both respect module weights and not be so easily/commonly overwritten by other modules. I considered why the entire _init logic wasn't simply in _nodeapi, and it became clear to me that this (including my patch) causes a limitation in which only nodes will receive a breadcrumb. _init must be being used to target any and all areas including administration pages, et cetera. The real question then arises, can we defer the output to all the places it needs to be (and what are those places exactly?) without the apparently somewhat problematic shotgun approach of hook_init() ?
Comment #3
matthandI just applied the patch on the newest dev version and got the following error when visiting /admin/settings/menu_breadcrumb:
call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'menu_breadcrumb_admin_settings_form' was given in /home/giantbal/public_html/includes/form.inc on line 382.
There were no errors while applying the patch, just afterwords. Any ideas?
Thanks much for working on this awesome module!
Comment #4
roball CreditAttribution: roball commentedChanging Status due to problem report in #3.
Comment #5
xurizaemonNote #1827248: Release co-ordination for Menu Breadcrumb 6.x-1.4 and 7.x-1.4 - if you want this fixed in the next release, now's the time to make it happen.
Comment #6
xurizaemonProbably related to #597994: Fatal error: Call to undefined function uc_price() in ...www/sites/all/modules/ubercart/uc_order/uc_order.module on line 1438, see also #897322: More developer-friendly API (ie: don’t do it all in hook_init()).
Comment #7
xurizaemonCleaning up issue queue. Closing all D6 issues.
If you believe this issue still applies to a supported version, feel free to re-open it. That would be a great time to check if the issue contains clear steps for reproducing the bug!
Thanks and sorry for any inconvenience.