The context_condition_menu::execute() method may set the active menu before inspecting the active menu trail: if the active menu is 'navigation' (the default one) it tries to determine the actual one by looking up the current menu item's href in the {menu_links} table. While doing this it does not take into account the possibility that more than one menu has a link for the current menu item, AAMOF the query has no order by clause. This leads to an arbitrary menu selection when more than one link is available.

CommentFileSizeAuthor
#1 context-909148-1.patch673 bytesplach

Comments

plach’s picture

Status: Active » Needs review
StatusFileSize
new673 bytes

The attached patch introduces an 'ORDER BY mlid ASC' clause to the query to give priority to menus having the older items.

shawn_smiley’s picture

I think this is a duplicate of issue #901606: Incorrect breadcrumbs when using menu contexts with the admin menu module, or at least the patch modifies the same code as the other issue.

plach’s picture

Status: Needs review » Closed (duplicate)

Yes, this is a duplicate. IMO this approach should be evaluated too so I'll repost the patch in the other issue.