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 2

becomes this:

Menu 1
  |
  +--Menu item 1
  |
  +--Menu item 2
  |
  +--Menu item 3

Menu 2
  |
  +--Submenu

The 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

c960657 - August 22, 2009 - 16:19
Status:active» needs work

_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.

AttachmentSizeStatusTest resultOperations
menu_link_move_children-1.patch12.09 KBIdleFailed: Failed to apply patch.View details | Re-test

#2

c960657 - August 22, 2009 - 16:19
Status:needs work» needs review

#3

sun - September 8, 2009 - 23:07

#4

oadaeh - September 21, 2009 - 22:23

@c960657: The patch did not work for me against the 7.x-dev released on September 21, 2009 at 05:10.

#5

c960657 - September 29, 2009 - 19:44

@oadaeh: Hmm, it works for me. What happens instead?

This is just a reroll.

AttachmentSizeStatusTest resultOperations
menu_link_move_children-2.patch12.08 KBIdleFailed: 13882 passes, 3 fails, 0 exceptionsView details | Re-test

#6

System Message - October 9, 2009 - 22:20
Status:needs review» needs work

The last submitted patch failed testing.

#7

c960657 - October 21, 2009 - 20:52
Status:needs work» needs review

Reroll.

AttachmentSizeStatusTest resultOperations
menu_link_move_children-3.patch12.12 KBIdleFailed: 14878 passes, 9 fails, 336 exceptionsView details | Re-test

#8

azriprajwala - October 22, 2009 - 10:10

@c960657 The patch worked for me, I used drupal7 from cvs.

#9

mattyoung - October 22, 2009 - 11:18

.

#10

System Message - November 8, 2009 - 20:00
Status:needs review» needs work

The last submitted patch failed testing.

#11

c960657 - November 10, 2009 - 21:06
Status:needs work» needs review

Reroll.

AttachmentSizeStatusTest resultOperations
menu_link_move_children-4.patch12.11 KBIdlePassed: 14948 passes, 0 fails, 0 exceptionsView details | Re-test
 
 

Drupal is a registered trademark of Dries Buytaert.