I am unable to add a secondary menu link to a node for the first menu in the menu list. My first menu listed alphabetically is named Attorneys and when I try to add a menu link pointing to that menu, it defaults to Primary Links instead. I can change it to any other menu except the first one in the list. As a test, I created a new menu named aaa so it would appear first in the list alphabetically and, sure enough, once I did that, I am now able to create secondary menu links for the Attorneys menu.

Comments

PeteS’s picture

Assigned: Unassigned » PeteS
lee20’s picture

Title: Unable to create a secondary menu link for the first menu in the list » Menu options missing from existing menu items drop down
Version: 6.x-1.0-beta4 » 6.x-1.x-dev
Assigned: PeteS » lee20
Status: Active » Needs work

I think this is the same issue that I am having. The issue seems to be that the first menu available in the drop down for adding a menu link is not available in the dropdown for existing menu links.

If you save the node without clicking the "Add Menu Item" button, the item is added to the proper menu. But if you edit and save the node again the original menu placement is lost and the item is reassigned to another menu.

I am working on a patch that resolves this.

lee20’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB

Attached is a patch which solves the issue for me.

The issue was caused when array_filter() filtered the default value for the multiple_node_menu_menus variable.

The first menu would be removed because it's index (which became the value following array_flip()) would return false during the array_filter().

lee20’s picture

Double post..

monotaga’s picture

The patch in #3 by lee20 solves my issue (which was the same one described by lee20 in #2).

Does it work for anyone else? RTBC?

PeteS’s picture

Status: Needs review » Reviewed & tested by the community

Committed for dev build -- thanks!

lee20’s picture

Status: Reviewed & tested by the community » Fixed

Marking as fixed since this has been committed! Thanks!

Status: Fixed » Closed (fixed)

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