Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2009 at 07:52 UTC
Updated:
21 Apr 2010 at 08:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
mooffie commentedExplanation for the patch: The existence of
$data['below']does not yet mean that there are child menu-items because these "below" items might all be mere callbacks, which aren't visible in a menu (they have their 'hidden' column set to '-1')).Comment #2
damien tournoud commentedIt's a little bit more complex then that. In Drupal 6, the class was set by theme_menu_item() based on the rendering of the menu below it:
Where $menu is
menu_tree_output($data['below']).We probably want to restore that logic. And we certainly want to write some tests for that.
Comment #3
mooffie commentedI agree, this is more robust; because it also answers for the case where there are normal children but all are invisible (because, for example, the user has no access rights to them).
Comment #4
mooffie commentedHere's a test.
Comment #5
mooffie commentedThat diff wasn't very good. Here's a corrected diff.
Comment #6
mooffie commented(A correction: the patch doesn't handle cases where the parent has only children to whom the user has no access rights; that is, it doesn't show such a parent as "leaf" (but as "collapsed"). I don't consider this a bug: such a parent isn't always in the active trail and when it isn't we aren't fetching its children --so we have no way of knowing if it's going to have visible children. So I don't see _much_ improvement in showing it as a "leaf" when it's in the active trail and as "collapsed" when it isn't (though some would say it _is_ an improvement).)
Comment #8
mooffie commented(Sure. The testcase (#5) failed because the patch (#3) wasn't applied. In other words, the failed testcase reveals the bug currently in Drupal.)
Comment #9
mooffie commentedI forgot to switch this to "needs review".
(I explained in #8 why "System Message"'s "failed testing" actually validated the testcase (#5).)
Comment #10
derjochenmeyer commentedI didn't find this issue when opening that one #767478: Menu li.leaf items get expanded (li.expanded) when active
It reuses tests #5 written by mooffie.
Comment #11
derjochenmeyer commentedMarking this as duplicate even though it was opened before #767478: Menu li.leaf items get expanded (li.expanded) when active to join forces.
Please test and review the patch over in the other issue.