I noticed that the state of a menu item that is associated with a node (via the integrated menu on-the-fly feature) gets resetted if the node is updated. That means for example, if you set the "expanded" flag in the menu administration, and then edit the node, this flag is not preserved but resetted.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Egon Bianchet’s picture

Version: 4.7.0-beta4 » 4.7.0
Status: Active » Closed (fixed)

Can't reproduce it in 4.7.0

JoshLangner’s picture

Version: 4.7.0 » 4.7.2
Status: Closed (fixed) » Active

I have been able to reproduce this problem in 4.7.2. This is a serious problem for me, because my site uses drop-down menus to operate. If one of the primary links gets edited, the expanded status gets reset, and the drop-downs no longer appear.

JoshLangner’s picture

NOTE: This bug is similar to, if not identical to, the bug found here: http://drupal.org/node/48178

JoshLangner’s picture

Correction:

This bug is similar to, if not identical to, the bug found here: http://drupal.org/node/18351

(copy-paste isn't exactly as smart as I sometimes think :) )

kkaefer’s picture

Another report of this bug: http://drupal.org/node/79881

JoshLangner’s picture

Here is a related bug: http://drupal.org/node/77569

I'm not certain if this is the Category module's fault or just the built-in menu-on-the-fly's fault.

venkat-rk’s picture

Category_menu relies on the core menu system (which includes menu_otf since 4.6), so I would bet it's probably menu_otf

kkaefer’s picture

Version: 4.7.2 » x.y.z

This bug does still exist in HEAD.

kkaefer’s picture

Assigned: Unassigned » kkaefer
Status: Active » Needs review
FileSize
806 bytes

I finally could track down this bug: In the menu fieldset on a node editing form, you can’t specify whether the menu item should be expanded by default or not. That means, the expanded index in the $edit array was missing. However, menu_edit_item_save just checked for $edit['expanded']. If it’s false or not set, the MENU_EXPANDED constant will be removed from the menu item. Now, this function checks first if the expanded index is present or not before altering $type.

profix898’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good and works as advertised.

kkaefer’s picture

FileSize
804 bytes

This patch is specifically for 4.7! For HEAD, use the patch above.

gemini’s picture

Not sure if this is the right place to post.

In my case I have top menu and side navigation which is set to be available in the post authoring form. Every time I go to edit a node that linked from top menu - menu item from the top menu appears in the menu settings and the parent item is restricted to side navigation. By updating the node it creates the menu in the side navigation which makes is redundant (it is already in top menu). By removing menu item name - it removes it from the original top navigation. So, restricting parent items in the administrative menu settings only to one menu still affects other menus that so not appear on the node creation/edition page. Can this be avoided?

kkaefer’s picture

Not sure if this is the right place to post.

It is not. Your problem is entirely different.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

kkaefer’s picture

Version: x.y.z » 4.7.4
Status: Fixed » Reviewed & tested by the community
killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed

applied

Anonymous’s picture

Status: Fixed » Closed (fixed)