Needs review
Project:
Local Menu
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Aug 2009 at 01:46 UTC
Updated:
8 Oct 2009 at 04:19 UTC
Jump to comment: Most recent file
On one site, we observed a behaviour where local_menu would behave inconsistently and simply not appear on some (mostly top-level) pages. Our site structure was the following:
The query in local_menu_block() was looking up entries in the menu_links table, but did not include any ORDER statement, so the returned values for a page with a top-level menu entry would behave inconsistently depending on which item was returned from the DB.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 561798-local_menu_inconsistent_matching.patch | 2.05 KB | xurizaemon |
Comments
Comment #1
xurizaemonHere's a fix which should give a precedence order to the menu trees, which produces more consistent behaviour for pages with multiple menu entries.
The only major change is that we add
ORDER BY menu_name = $active DESC, menu_name = $primary DESC, menu_name = $secondary DESCto the query which looks for which menu to use.There may be a better way to decide this (perhaps menu item depth?) but this seems a step in the right direction.
Using
menu_get_active_menu_name()as the preferred selection means that we'rePatch is against HEAD.
Comment #2
xurizaemonI have to write myself a userscript that detects when I've attached a .patch file, and reminds me to change the issue status.
Comment #3
xurizaemonAlso of interest: implementation of menu weighting @ http://drupal.org/node/595282