Menu items do not follow parent when moving to new menu . . .
oadaeh - March 20, 2009 - 15:29
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | menu system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
If I edit a menu item that has children, and select a new parent, the children move to the old parent of the menu item that was moved.
An illustration!
In the following example, if I 'edit' 'Submenu' and change it's 'Parent item' to 'Menu 2', then all of its menu items move to be under 'Menu 1', so that this:
Menu 1
|
+--Submenu
|
+--Menu item 1
|
+--Menu item 2
|
+--Menu item 3
Menu 2becomes this:
Menu 1
|
+--Menu item 1
|
+--Menu item 2
|
+--Menu item 3
Menu 2
|
+--SubmenuThe way it currently stands, the only way to move an entire tree is to drag and drop it, but that doesn't work when moving a tree from one menu to another. If I want to move the entire tree to a new menu, I have to edit each and every item and manually set them into their old positions in the new menu.

#1
_menu_link_move_children() tried to move the child elements in an efficient but very complicated way, but failed. This patch makes the function much simpler. Considering that menu items aren't moved that often, I think this is a good trade-off.
#2
#3
subscribing
#4
@c960657: The patch did not work for me against the 7.x-dev released on September 21, 2009 at 05:10.
#5
@oadaeh: Hmm, it works for me. What happens instead?
This is just a reroll.
#6
The last submitted patch failed testing.
#7
Reroll.
#8
@c960657 The patch worked for me, I used drupal7 from cvs.
#9
.
#10
The last submitted patch failed testing.
#11
Reroll.