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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

inolen’s picture

FileSize
1.32 KB

Fixed. 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!

coderintherye’s picture

Status: Active » Reviewed & tested by the community

Patch 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.

Anonymous’s picture

we've hit this problem with order-of-execution with panels as well, so +1 to the patch.

wpatt’s picture

This 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()?

Davidovich’s picture

FileSize
1.27 KB

Thanks 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.

JohnAlbin’s picture

Title: Using panels, active trail breaks when "breadcrumb" page element is added » Panels content isn't affected by menu position rules
Status: Reviewed & tested by the community » Fixed

Thanks!

Fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

JohnAlbin’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Closed (fixed) » Needs review
FileSize
1.23 KB

It 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.

AaronBauman’s picture

Status: Needs review » Postponed

#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.

BarisW’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

Since D6 is not being updated anymore, I decided to cleanup the issue queue by closing all D6 issues.