Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2007 at 01:34 UTC
Updated:
9 Aug 2007 at 22:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
pwolanin commentedok, following these exact steps I can reproduce the bug. I'm using PHP 4.4 on OS X, webernet is using XAMPP (PHP 5.2.3), so seems not to be a PHP issue.
So my guess is a 99% liklihood the bug is in function _menu_tree_data(). The render function, menu_tree_output(), is too simple to have a subtle bug.
Comment #2
pwolanin commentedconfirmed that the data coming out of _menu_tree_data() has the wrong structure.
Somehow it seems that 6 is getting set as directly 'below' 4b, while 5b is incorrectly set as a sibling of 4b.
Comment #3
pwolanin commentedok, here's a CLI query result - looks correct:
This query corresponds to viewing "page6" or "5b". Viewing "4b" the menu renders correctly (i.e. "5b" appears to be below "4b").
here's how it looks:
vs the correct structure when 4b is the active link:
Comment #4
pwolanin commentedAh, looking at the query results above gave me the possible solution - we DO need to ORDER BY p6 (or pN where N = MENU_MAX_DEPTH) to insure that all children are returned in a query AFTER their parent.
Starter patch attached. This corrects the problem for me.
Comment #5
pwolanin commentedNote this also explains why the bug appears to be sporadic - it will only be in evidence when a link at depth 6 has a mlid that is less than that of its parent.
I think the patch above should just be considered proof-of-principle for the fix. The real fix will be included in this patch: http://drupal.org/node/154470
Comment #6
pwolanin commented