Opened 9 years ago
Last modified 5 years ago
#34803 new defect (bug)
Deleting menu item with sub-items does not update sub-items' parent (with disabled JS)
Reported by: | JanVoracek | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | has-patch |
Focuses: | Cc: |
Description
This bug appears only with disabled JavaScript.
If I create menu with following structure:
- Parent
- Child 1
- Child 2
- Child 1
and I delete Child 1, it should look like this:
- Parent
- Child 2
The problem is that WP does not update the Child 2 's parent (postmeta _menu_item_menu_item_parent) with disabled JavaScript.
Attachments (2)
Change History (8)
#3
@
9 years ago
- Keywords dev-feedback added
Tried the patch 34803.diff and can confirm that it works for a couple of scenarios that I tested.
#4
@
9 years ago
- Keywords needs-unit-tests added; dev-feedback removed
Few points of feedback on the patch:
- I like how the logic is internalised to
wp_delete_post()
. Seems reasonable. - Like parent post reassignment immediately preceding in the function call, the procedure should also clear meta cache for affected nav items.
- Needs test coverage.
Note: See
TracTickets for help on using
tickets.
Reassign child nav menu items to the grandparent before deleting a nav-menu-item post.