Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Is this a known issue?
Set up a rule on a page, convert to a panel, check menu trail, add breadcrumb page element, check again and it's no longer working.
I felt pretty hopeless glancing at the menu_position code, but it seemed like it may have something to do with the timing expected by menu_position_page_delivery_callback_alter.
Comment | File | Size | Author |
---|---|---|---|
#8 | 1248040-8-panels-fix.patch | 1.23 KB | JohnAlbin |
#5 | panels_fix.patch | 1.27 KB | Davidovich |
#1 | panels_fix.patch | 1.32 KB | inolen |
Comments
Comment #1
inolen CreditAttribution: inolen commentedFixed. The problem is that panels content is rendered before menu_position_page_delivery_callback_alter().
I couldn't really find a better hook, so I used hook_panels_pane_content_alter() and threw a static variable in menu_position_page_delivery_callback_alter() so that it wouldn't evaluate multiple times.
Thanks for this excellent module!
Comment #2
coderintherye CreditAttribution: coderintherye commentedPatch works, looks pretty good on standards, and didn't receive a noticeable performance hit.
Hopefully some others can chime in on this, as I'm not going to say that I fully understand the implications of this hook approach, but it does what it says it does and looks to conform to standards.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedwe've hit this problem with order-of-execution with panels as well, so +1 to the patch.
Comment #4
wpatt CreditAttribution: wpatt commentedThis patch works for me as well, but does not remove PHP errors when a menu block is in the panel layout (as opposed to just a block region). What is the down side to evaluating the menu position rules before the page callback during hook_site_status_alter()?
Comment #5
Davidovich CreditAttribution: Davidovich commentedThanks for the above patch.
This same issue was also affecting menu blocks in panels, and the patch mostly fixed it, however not everywhere. Moving the panels hook to hook_panels_pre_render seems to run it more reliably before both menus and breadcrumbs.
Comment #6
JohnAlbinThanks!
Fixed.
Comment #8
JohnAlbinIt seems this needs to be backported to Drupal 6.
However, I'm not sure if the D6 version of Panels has the same hook_panels_pre_render() hook. Needs testing.
Comment #9
AaronBauman#8 works after this patch is applied to menu_block: #1339042-1: Examine entire active trail to find a relevant menu, instead of just the current page
Postponing on acceptance of that patch, or similar functionality.
Comment #10
BarisW CreditAttribution: BarisW as a volunteer and at LimoenGroen commentedSince D6 is not being updated anymore, I decided to cleanup the issue queue by closing all D6 issues.