Discovered while trying to use Menu Position with Special Menu Items, the breadcrumb trail does not get set because Special Menu Items calls drupal_get_breadcrumb() and drupal_set_breadcrumb() in hook_init(). This causes the 'menu_set_active_trail' and 'drupal_set_breadcrumb' static caches to be initialised too early for menu_position_activate_rule() to have any effect.
The attached patch fixes this by explicitly resetting these static caches when setting breadcrumbs. This could perhaps be considered a bug in Special Menu Items, but I suspect other breadcrumb related modules may cause the same problem.
Comment | File | Size | Author |
---|---|---|---|
#16 | menu_position-special_menu_items-1461384-16.patch | 709 bytes | dabblela |
#15 | menu_position-special_menu_items-1461384-15.patch | 869 bytes | dabblela |
#7 | menu_position-special_menu_items-1461384-6.patch | 744 bytes | rattusrattus |
menu_position-special_menu_items.patch | 853 bytes | longwave |
Comments
Comment #1
mp165 CreditAttribution: mp165 commentedthanks @longwave - exactly what i needed!
Comment #2
ressa CreditAttribution: ressa commented@longwave, great work! I am using Menu Position with Menu Breadcrumb, and the breadcrumb wouldn't show up, but the patch made it appear. Without the title, though, even though I have 'Append page title to breadcrumb' selected in Menu Breadcrumb settings. But I have a breadcrumb and that's what counts.
Comment #3
Wolfgang Reszel CreditAttribution: Wolfgang Reszel commentedThanks, this patch helps with Menu Breadcrumb. As I add the page title through the theme (Zentropy) it works perfect.
Comment #4
mansspams CreditAttribution: mansspams commentedPatch works, but Menu Breadcrumb cannot add page title. Can something be done about it in Menu Breadcrumb module? I also tried to edit module weights, but that does not help.
Comment #5
Erik Seifert CreditAttribution: Erik Seifert commentedWork also for panel paths like 'node/%node/article'
Comment #6
Rob_Feature CreditAttribution: Rob_Feature commentedYup, works for me with menu breadcrumbs as well. Marking "reviewed and tested" since it seems like we've got a few folks reporting success.
Comment #7
rattusrattus CreditAttribution: rattusrattus commentedPatch updated to use paths relative to the module directory. Great work on this one, just what I needed.
Comment #8
Ludo.RChanging modules weight has no effect because of this :
Perhaps menu_position should give a chance to other modules to alter the breadcrumb (like adding the current page title).
This could be done inside this function, by adding a drupal_alter() before setting active trail :
However, should menu_position prevail over all other breadcrumb related modules?
Using menu_position makes all other modules useless.
Comment #9
harrrrrrr CreditAttribution: harrrrrrr commentedThe patch in #7 works fine for me. (I have no problem with the title, it's added to the bc trail)
Comment #10
ckrinaPatch in #7 works for me using Panels and solves my problem in this context.
Comment #11
rv0 CreditAttribution: rv0 commentedPatch in #7 works for me
Upping priority as the patch is 5 months old.
Comment #12
Fabianx CreditAttribution: Fabianx commented+1 for RTBC (using this in production)
Please lets get #7 in.
#8: An alter hook is a nice idea.
Overriding other modules is no problem, because you can select _when_ to apply menu position rules. Want another module? Just don't use mpr on this path.
Comment #13
vlad.dancer+1 for #7. Work for me too
Comment #14
Sborsody CreditAttribution: Sborsody commentedThe patch in #7 solved an issue of the breadcrumb not appearing in a panel. Yay!
Comment #15
dabblela CreditAttribution: dabblela commentedPatch in #7 had whitespace issues for me. Re-rolled.
Comment #16
dabblela CreditAttribution: dabblela commentedSorry, path issues in that one.
Comment #17
Heorhi Lazarevich CreditAttribution: Heorhi Lazarevich commentedPatch in #7 works for me using Adaptive Theme with options "Append the page title to the breadcrumb trail" enabled. Without this patch only page title was showing in the breadcrumbs without menu trail.
Comment #18
troybthompson CreditAttribution: troybthompson commented#16 solved the problem for me.
Comment #19
peterlolty CreditAttribution: peterlolty commentedComment #20
Alan D. CreditAttribution: Alan D. commentedYep, another rtbtc by me :)
Mine broke when using special menu items which was setting the trail.
Normally, I would not consider this a critical priority issue as there are not any wsod (white screens of death) or data loss. But this is really major as it is not actually working without it!
Comment #21
troybthompson CreditAttribution: troybthompson commentedSolved my problem as well.
Comment #22
jhedstromAnother RTBC here. Fixes the conflict with items nested under a special menu item.
Comment #23
kbentham CreditAttribution: kbentham commentedRTBC here as well. This fixed my breadcrumb issues.
Comment #24
bryanhirsch CreditAttribution: bryanhirsch commentedRTBC, resolves my issues.
Comment #25
Agogo CreditAttribution: Agogo commented#16 fixed my problem with the breadcrumb as well. Someone please commit this.
Comment #26
peterlolty CreditAttribution: peterlolty commentedRTBC, resolves my issues. thanks.
Comment #27
akalata CreditAttribution: akalata commentedRTBC bump :)
Comment #28
schwarli4783 CreditAttribution: schwarli4783 commented#16 solved the problem for me.
Comment #29
jenlampton#16 works for me to, +1 on RTBC
Comment #30
Rob_Feature CreditAttribution: Rob_Feature commentedUm. "Me Too". This has been an issue forever...Would LOVE to see this committed!!!!
Comment #31
alexanansi CreditAttribution: alexanansi commentedNot using special menu items, but whatever what was causing the problem was fixed by this patch
Comment #32
BarisW CreditAttribution: BarisW as a volunteer and at LimoenGroen commentedRTBC-ed 3 years ago. Patch fixes the issue for a lot of people. Can this please be committed?
I'm happy to become co-maintainer if time is the issue here.
Comment #33
vood002 CreditAttribution: vood002 commentedThank you! #16 solved my problems
Comment #34
peterlolty CreditAttribution: peterlolty as a volunteer commentedThis is already set to critical, so hope the maintainer look at here soon.
ps. RTBC is for #16
Comment #36
BarisW CreditAttribution: BarisW as a volunteer and at LimoenGroen commentedCommitted and pushed to 7.x-1.x-dev. Thanks all!