Closed (fixed)
Project:
Drupal core
Component:
menu system
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
12 Nov 2005 at 13:04 UTC
Updated:
2 Dec 2005 at 14:00 UTC
Jump to comment: Most recent file
The menu item 'create content' shows up on the admin/menu page as (disabled).
This menu item is created as a "MENU_ITEM_GROUPING" so that it is only visible in the menu tree if it has children. A side effect is that its MENU_VISIBLE_IN_TREE flag is not set so it shows up as disabled.
Perhaps the disabled flag should only be shown if all three flags MENU_VISIBLE_IN_TREE, MENU_VISIBLE_IN_BREADCRUMB and MENU_VISIBLE_IF_HAS_CHILDREN are clear?
I'm happy to roll up a patch that implements that change if people think it's a good idea.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | menu_if_has_children_0.diff | 5.92 KB | Richard Archer |
| #2 | menu_back_out.diff | 3.67 KB | Richard Archer |
| #1 | menu_if_has_children.diff | 1.24 KB | Richard Archer |
Comments
Comment #1
Richard Archer commentedIt is actually not possible to disable these MENU_VISIBLE_IF_HAS_CHILDREN menus.
The 'disable' link only clears the MENU_VISIBLE_IN_TREE and MENU_VISIBLE_IN_BREADCRUMB flags. So even if such a menu is disabled, it still shows up in the Navigation block if it has children.
It would be very unfriendly to clear the MENU_VISIBLE_IF_HAS_CHILDREN flag on disabling a menu because there is currently no way to turn that flag back on short of hitting 'reset'. And if the user has moved this menu somewhere else, reset will put it back in the default position.
Also... what would happen if the menu had no children? You would click enable but the menu still wouldn't show up in the Navigation block. Baffling!
One way to approach this troublesome behaviour would be to add a checkbox to the edit menu page for this setting. Then, if the admin gets confused, they can click 'edit' and say "Aah! I see, this menu only appears in the tree if it has children".
But this setting is so obscure that adding such a checkbox would really only be cluttering up the interface with an option that is only there to explain a quirk.
So the attached patch simply turns the 'enable/disable' link off for these menus, effectively hiding all this confusing behaviour. And removes the '(disabled)' tag.
It doesn't alter the breadcrumb behaviour because there's another patch in the queue which does that and I expect that patch will be accepted after a bit more work. (http://drupal.org/node/29621)
Comment #2
Richard Archer commentedWhen this patch was committed to HEAD part of another patch was also committed.
This patch backs those extra changes out.
Comment #3
Richard Archer commentedActually, the first patch only fixed half the problem. These menus were still showing up as (disabled) in drop-down 'parent item' menus.
This patch backs out the accidental commit and also implements a better solution to the original problem. The code that generates rows is now easier to understand and easier to extend.
Comment #4
dries commentedCommitted to HEAD. Thanks.
Comment #5
(not verified) commented