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.
Comment | File | Size | Author |
---|---|---|---|
#31 | mysql_is_braindead_die_die_die.patch | 9.64 KB | chx |
#26 | 408482-25.patch | 10.72 KB | dixon_ |
#25 | 408482-24.patch | 10.67 KB | drifter |
#21 | 408482-21.patch | 11.07 KB | drifter |
#16 | menu_link_move_children-7.patch | 12.68 KB | c960657 |
Comments
Comment #1
c960657 CreditAttribution: c960657 commented_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.
Comment #2
c960657 CreditAttribution: c960657 commentedComment #3
sunsubscribing
Comment #4
oadaeh CreditAttribution: oadaeh commented@c960657: The patch did not work for me against the 7.x-dev released on September 21, 2009 at 05:10.
Comment #5
c960657 CreditAttribution: c960657 commented@oadaeh: Hmm, it works for me. What happens instead?
This is just a reroll.
Comment #7
c960657 CreditAttribution: c960657 commentedReroll.
Comment #8
pflame CreditAttribution: pflame commented@c960657 The patch worked for me, I used drupal7 from cvs.
Comment #9
mattyoung CreditAttribution: mattyoung commented.
Comment #11
c960657 CreditAttribution: c960657 commentedReroll.
Comment #12
c960657 CreditAttribution: c960657 commentedReroll.
Comment #13
c960657 CreditAttribution: c960657 commentedComment #14
c960657 CreditAttribution: c960657 commentedReroll (due to #682784: Once created, menu item query strings can never be deleted).
Comment #16
c960657 CreditAttribution: c960657 commentedSorry, the last patch contained some unrelated changes.
Comment #17
c960657 CreditAttribution: c960657 commentedComment #18
oadaeh CreditAttribution: oadaeh commentedI just tried the patch from comment #16 on the latest 7.0-dev version, and when I moved a menu item with sub-menu items to another menu, the sub-items did not follow it. I tried it with two different menu items to two different menus, just to be sure.
It was a brand-new, standard install (as opposed to minimal) with nothing done after the install other than apply this patch.
The patch did apply cleanly with no errors, and I can see that it was integrated with the code base correctly.
Comment #19
sunCan we build a "proper" $fields update array and assign that with $query->fields($fields) ?
137 critical left. Go review some!
Comment #20
sun#886620: Child menu links are lost in nirvana after moving parent link has been marked duplicate. This issue/patch blocks the critical issue #576290: Breadcrumbs don't work for dynamic paths & local tasks
Also, #886620 identified that this is not limited to moving links to a new menu. Links end up in nirvana when moving within the same menu, too. At the very least major, if not critical.
Comment #21
drifter CreditAttribution: drifter commentedMenu names were not being updated in patch #16, fixed. Also, rewritten the update expression syntax to fields as per #20.
Comment #22
chx CreditAttribution: chx commentedthat's not going to fly.
Comment #23
chx CreditAttribution: chx commentedhttp://drupal.org/node/576290 depends on this so critical.
Comment #24
chx CreditAttribution: chx commentedAnyone following home: the original function while might be complicated did one database update instead of recursing in PHP. The Drupal 6 menu system was designed for hundreds of thousands (or even more) menu links and PHP recursion won't cut it. I am fixing the oriignal.
Comment #25
drifter CreditAttribution: drifter commentedEhm, typo, thanks chx!
Comment #26
dixon_Here is a simple reroll that fixes a bad function call and a code style issue. Using this patch, it seems to fix the problem for me.
Bad function call
Code style issue.
Powered by Dreditor.
Comment #27
drifter CreditAttribution: drifter commentedPosted the same second :)
Comment #28
dixon_Sorry for cross posting... My patch also includes a minor code style issue, though.
Comment #29
dixon_Comment #30
chx CreditAttribution: chx commentedStop rerolling this patch it's the wrong approach.
Comment #31
chx CreditAttribution: chx commentedLet's see this one. The DBTNG conversion missed an important comment from D6... also the query can be simplified a very little: A - (-B) is just A+B (for depth).
Comment #32
hunvreus CreditAttribution: hunvreus commentedWorked perfectly.
Comment #33
pwolanin CreditAttribution: pwolanin commentedLooks good to me (assuming tests pass) - chx and I discussed the underlying bug, so the only trick was for him to figure out how to properly make it work with DBTNG.
Comment #34
pwolanin CreditAttribution: pwolanin commentedcross post
Comment #35
Dries CreditAttribution: Dries commentedThe tests pass according to the test bot (but the issue isn't updated yet). Committed to CVS HEAD. Thanks!