Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#13600 closed defect (bug) (fixed)

Menu Hierarchy not saving correctly (video)

Reported by: nathanrice's profile nathanrice Owned by: filosofo's profile filosofo
Milestone: 3.0 Priority: normal
Severity: blocker Version: 3.0
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

I was playing with the 3.0RC and noticed a bug when I was building a menu.

Basically, I added 3 top level pages ... then added 6 other pages which I made subpages of one of the original 3 top level pages ... then added 2 more pages, and made them subpages of another of the original 3 top level pages. Finally, I added 3 categories as top level.

When I saved the menu, the 6 subpages I added reverted to top level links, but the 2 other subpages I added maintained their hierarchy.

Please watch this video for a demonstration/explanation.

I don't know why this is happening. Probably over my head.

Attachments (1)

menu-item-parent-sanity-check.13600.diff (3.2 KB) - added by filosofo 14 years ago.

Download all attachments as: .zip

Change History (9)

#1 follow-up: @nacin
14 years ago

  • Severity changed from normal to blocker

Also, "(Pending)" should be non-JS only if I recall our conversation correctly.

#2 in reply to: ↑ 1 @nathanrice
14 years ago

Replying to nacin:

Also, "(Pending)" should be non-JS only if I recall our conversation correctly.

Yeah, I thought that looked weird.

#3 @nathanrice
14 years ago

Also, I made a much shorter video demonstrating the bug. Sorry about that.

#4 @duck_
14 years ago

Somehow the Home item is messing with the ordering. Quick tests only happening for me when I add the Home item along with a bunch of other items which I place into an order.

#5 @nacin
14 years ago

Per duck_ in IRC, it's reproducible only when adding the Home link, and probably only for hierarchy created on the same pageload as the home link. We have special code that always inserts the home link to the top. I imagine it is also only reproducible when the home link is added along with other pages at the same push of the "Add to Menu" button.

Simple solution would probably be to remove our toTop() code. It feels odd to do that anyway now that it is built in to Pages > View All instead of being its own separate step/link/function. (Then again, some people may find the admin to be smart for inserting Home at the top.)

#6 @filosofo
14 years ago

  • Owner set to filosofo
  • Status changed from new to accepted

#7 @filosofo
14 years ago

  • Keywords has-patch added; needs-patch removed

#8 @nacin
14 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [15049]) Sanity check menu item parents and fix HTML issues. props filosofo, fixes #13600.

Note: See TracTickets for help on using tickets.