Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#62925 accepted defect (bug)

Non-unique names for inputs in nav-menu

Reported by: kkmuffme's profile kkmuffme Owned by: joedolson's profile joedolson
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

/wp-admin/nav-menus.php

e.g. in the

<form id="nav-menu-meta" class="nav-menu-meta" method="post" enctype="multipart/form-data">

If there are custom menus (e.g. WooCommerce) but possibly also only with native ones, it's possible that there are multiple different input with identical name= which will cause issues on form submit/processing.

e.g.

<input type="hidden" class="menu-item-title" name="menu-item[-1][menu-item-title]" value="Some Text"/>

I have multiple elements in the navigation that all have "menu-item[-1][menu-item-title]" as name (starting from -1 all the way up to -133 which is the number of elements in the navigation)
Also affects other elements like menu-item[-1][menu-item-url],...

Change History (3)

This ticket was mentioned in PR #8296 on WordPress/wordpress-develop by @snehapatil02.


4 months ago
#1

  • Keywords has-patch added

This PR fixes an issue where custom menu items in the WordPress navigation menu were being generated with duplicate input names, causing potential form submission and processing issues.

Trac ticket: https://core.trac.wordpress.org/ticket/62925

#2 @joedolson
4 months ago

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

#3 @joedolson
4 months ago

  • Severity changed from major to normal
Note: See TracTickets for help on using tickets.