Opened 3 years ago
Last modified 2 months ago
#57170 new defect (bug)
Fix invalid menu-item-parent
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Customize | Keywords: | reporter-feedback has-patch |
| Focuses: | Cc: |
Description
Follow up to #56926.
There seems to be a bug in the Customizer that may set $menu_item->menu_item_parent to be the same as $menu_item->ID. Steps to reproduce: https://core.trac.wordpress.org/ticket/56926#comment:21. There also seems to be a related JS error:
Uncaught TypeError: parentControl is undefined
.../wp-admin/js/customize-nav-menus.js?ver=6.2-alpha-54642-src:2330
Attachments (2)
Change History (20)
This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by costdev. View the logs.
3 years ago
#4
@
3 years ago
- Milestone changed from 6.2 to 6.3
This ticket was discussed in the bug scrub and it was agreed to move this ticket to 6.3.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
3 years ago
#6
@
3 years ago
- Milestone changed from 6.3 to 6.4
Due to lack of activity and a patch I am moving this ticket to the 6.4 milestone.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by oglekler. View the logs.
2 years ago
#9
@
2 years ago
This ticket was discussed during a bug scrub. Last chance for this ticket :)
Because we already moved it a couple of times, the next step for it is Future releases.
Add props to @mukesh27
#10
@
2 years ago
- Milestone changed from 6.4 to 6.5
We have no patch and solving the issue can be tricky, so I am moving this to 6.5.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
2 years ago
#12
@
2 years ago
- Milestone changed from 6.5 to Future Release
As per today's bug scrub, we decided to move this ticket to Future Release to give it more time to get a patch.
This ticket was mentioned in PR #9222 on WordPress/wordpress-develop by @lakshyajeet.
8 months ago
#13
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/57170
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
### Before:
https://github.com/user-attachments/assets/4c033e42-9553-4295-b949-90e2797bae7f
### After:
https://github.com/user-attachments/assets/73d5d9e6-7898-464f-b2f3-9525408e62a3
This ticket was mentioned in Slack in #core-test by oglekler. View the logs.
7 months ago
#18
@
2 months ago
- Keywords needs-testing removed
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/9222
Steps to Reproduce or Test
- Go to Appearance ▸ Customize ▸ Menus.
- Open the browser developer tools and switch to the Console tab.
- Create a new menu.
- Add multiple menu items to the menu.
- Set one menu item as a submenu (child) of another menu item.
- Click Publish, then reload the page.
- Open Appearance ▸ Customize ▸ Menus again and select the same menu.
- Remove the parent menu item of the submenu item.
- Reassign the submenu item to a parent again using the menu item settings in the right panel.
- Click Publish, then reload the page.
- Open the menu again in the Customizer.
- Select the submenu item and click Reorder.
- Press the left arrow key to move the submenu item out of its parent.
- Observe the browser console.
Expected Results
✅ No JavaScript errors should be logged in the browser console.
✅ The submenu item should be successfully reordered and moved out of its parent.
Environment
- WordPress: 7.0-alpha-61215-src
- PHP: 8.2.29
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
- Browser: Chrome 143.0.0.0
- OS: macOS
- Theme: Twenty Twenty 3.0
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Actual Results
Before applying the patch
❌ A JavaScript error is logged in the browser console:
Uncaught TypeError: Cannot read properties of undefined customize-nav-menus.js?ver=7.0-alpha-61215-src
❌ The submenu item cannot be reordered using the left arrow key.
After applying the bugfix patch
✅ No JavaScript errors are logged in the console.
✅ The submenu item can be reordered correctly.
Screenshots
| Before Apply Patch | After Apply Patch ✅ |
|
|


Thanks @azaozz for the ticket!
This ticket was discussed during the recent bug scrub. It looks like it's unlikely that work will be done on this during the 6.2 cycle.
Is this still possible to land in 6.2, or should it be moved to
Future Releasefor now?