If a menu block is configured to use "the menu selected by the page", a page with a disabled menu item will still trigger that menu to be used and will render the menu block.

This is due to a bug where menu block checks the database for a menu item, but fails to check if the menu item is enabled.

Comments

JohnAlbin’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

JohnAlbin’s picture

Status: Closed (fixed) » Active
JohnAlbin’s picture

Menu position rules are "disabled" but have the "alter" flag on so that they can programmatically enable themselves per page view. This patch would have meant menu position rules would be ignored by menu block's "the menu selected by the page" feature.

JohnAlbin’s picture

This is an edge case. And no one seems to be complaining except me. :-)

  • JohnAlbin committed b634ca1 on 8.x-1.x
    Issue #1701702: Disabled menu items still trigger "the menu selected by...
runnergirl’s picture

I ran into this same issue this week, so it appears it hasn't been corrected/fixed. In my case, I had disabled a menu, but it still reacted as if it were 'enabled' when I would go to that page and view the left navigation block menu. It didn't list the proper menu items that were on the main menu drop down but rather the menu items that were part of the main menu drop down that I had disabled it from.

Also, in my case, this particular menu item was listed twice (under different menus), but I initially thought disabling it in the one location would 'take care' of it not displaying with those menu items. It didn't. Even though it was disabled under those particular menu items, it still would pull in those menu items on the left navigation block for that page. This was even while I had it enabled under the proper main menu drop down.
Once I deleted the duplicate menu item (the one that was disabled), the left navigation block then displayed the correct menu items for that page, finally looking to the menu item I had enabled for that particular main menu drop down.

Bottom line, a person expects any menu that is disabled to be truly disabled.

jenlampton’s picture

Issue summary: View changes

It looks like the commit referenced here was to the Drupal 8 version of the module, where the problem reported was for Drupal 7.

I think this problem may also be related to (disabled) Menu Position links appearing in menu blocks. See https://www.drupal.org/project/menu_position/issues/2994183 for an in-depth explanation of the issue.

I tested the fix from the commit here, but instead of preventing the disabled link from appearing in the menu block, the whole menu block disappeared form the page. That's not my desired result. I'm noting this behavior here in case that also causes issues for people in Drupal 8, where the change was committed.

AaronBauman’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev

Still a problem in 8.x-1.10