[wp-trac] [WordPress Trac] #32760: Customizer Menus: cannot save a menu with the same name as an existing menu

WordPress Trac noreply at wordpress.org
Sat Jun 27 20:51:05 UTC 2015


#32760: Customizer Menus: cannot save a menu with the same name as an existing menu
--------------------------+--------------------------
 Reporter:  designsimply  |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.3
Component:  Customize     |     Version:  trunk
 Severity:  major         |  Resolution:
 Keywords:  needs-patch   |     Focuses:  javascript
--------------------------+--------------------------

Comment (by westonruter):

 For reference, currently in Core, the admin page will just block the
 creation of a new menu that has the same name as an existing menu:
 https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/nav-
 menu.php#L227

 This works OK for the admin page because the menu has to be created up-
 front before adding menu items. In the Customizer, however, the menu gets
 “staged” and items are added to it before everything gets
 created/persisted in the database at Save & Publish. The Customizer
 doesn't have a good pattern in place for doing server-side validation that
 blocks a save from happening, so as noted above, I think we need to
 gracefully handle conflicts by amending the name with a number upon
 saving, just as the post slug duplicates are handled.

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


More information about the wp-trac mailing list