[wp-trac] [WordPress Trac] #57170: Fix invalid menu-item-parent

WordPress Trac noreply at wordpress.org
Fri Jan 16 13:37:33 UTC 2026


#57170: Fix invalid menu-item-parent
-----------------------------------------+-----------------------------
 Reporter:  azaozz                       |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Future Release
Component:  Customize                    |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  reporter-feedback has-patch  |     Focuses:
-----------------------------------------+-----------------------------
Changes (by huzaifaalmesbah):

 * keywords:  reporter-feedback has-patch needs-testing => reporter-feedback
     has-patch


Comment:

 == Test Report

 Patch tested: https://github.com/WordPress/wordpress-develop/pull/9222

 === Steps to Reproduce or Test
 1. Go to **Appearance ▸ Customize ▸ Menus**.
 2. Open the **browser developer tools** and switch to the **Console** tab.
 3. Create a new menu.
 4. Add multiple menu items to the menu.
 5. Set one menu item as a **submenu (child)** of another menu item.
 6. Click **Publish**, then reload the page.
 7. Open **Appearance ▸ Customize ▸ Menus** again and select the same menu.
 8. Remove the **parent menu item** of the submenu item.
 9. Reassign the submenu item to a parent again using the menu item
 settings in the right panel.
 10. Click **Publish**, then reload the page.
 11. Open the menu again in the Customizer.
 12. Select the submenu item and click **Reorder**.
 13. Press the **left arrow key** to move the submenu item out of its
 parent.
 14. 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 ✅ ||
 || [[Image(https://i.ibb.co.com/fzYmrTZr/Huzaifa-20260116184406.png)]] ||
 [[Image(https://i.ibb.co.com/gZ1k5hL0/Huzaifa-20260116191124.png)]] ||

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57170#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list