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.

Comments

Richard Archer’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB

It 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)

Richard Archer’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.67 KB

When this patch was committed to HEAD part of another patch was also committed.
This patch backs those extra changes out.

Richard Archer’s picture

StatusFileSize
new5.92 KB

Actually, 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.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)