Drupal 7.0 has this (IMO critical) bug that prevents active trails from being added to all menu trees. Basically, this means that if you have a path that is in 2 or more different menus and you have blocks showing for all of those menus, only one of those menu trees will receive an active trail. See #942782: Custom menus never receive an active trail

In Drupal 6, every menu tree received an active trail if the current path was in the menu tree.

But we can work around it with a little code added to menu_block.

CommentFileSizeAuthor
#3 1017142.patch7.25 KBjohnalbin

Comments

johnalbin’s picture

Title: path in multiple menus only appears in one active trail per page » except for one menu, all other menus (including books) never receive an active trail - #1017122 by becw, mfer and JohnAlbin: Cor

different manifestation of the same problem: any menu block showing a book menu don't get an active trail either.

johnalbin’s picture

Title: except for one menu, all other menus (including books) never receive an active trail - #1017122 by becw, mfer and JohnAlbin: Cor » except for one menu, all other menus (including books) never receive an active trail
johnalbin’s picture

Status: Active » Needs work
StatusFileSize
new7.25 KB

This patch is killing me. :-p

Here's a work-in-progress-god-i'm-tired-going-to-bed patch attempt. In case the elves show up in my cobbler's workshop during the night and magically fix everything.

johnalbin’s picture

Stupid elves.

johnalbin’s picture

Status: Needs work » Fixed

99.5% fixed.

To be 100% fixed on a particular site, do NOT mix menu_block blocks with core menu blocks. Depending on the order that the blocks are built, the core menu block will still hit this bug and then cache the result so that the menu_block will also exhibit the bug. If, on the other hand, you leave out the core menu block, the menu_block block will build correctly using the work-around code I just committed.

http://drupal.org/cvs?commit=478952

I could build a 100% work-around. But based on preliminary work, the code will be super messy and possibly horribly expensive in CPU cycles. :-p Not worth it, IMO.

Status: Fixed » Closed (fixed)

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

mikl’s picture

ergophobe’s picture

Just to add to mikl's comment....

This patch and that commit were completely obsoleted with Drupal 7.12, which broke this fix and the file that is added in this patch was removed and a more definitive fix committed related to #1425342: Drupal core upgrade from 7.10 to 7.12 causes menu block to fail

Menu Block 2.3 was released to address this using the patch in the referenced issue, msg #33 https://drupal.org/comment/5549484#comment-5549484