[wp-trac] [WordPress Trac] #32672: Unable to assign Menu location when creating the first menu

WordPress Trac noreply at wordpress.org
Mon Jul 6 07:30:31 UTC 2015


#32672: Unable to assign Menu location when creating the first menu
-------------------------------------+--------------------------
 Reporter:  dinamiko                 |       Owner:  westonruter
     Type:  defect (bug)             |      Status:  assigned
 Priority:  high                     |   Milestone:  4.3
Component:  Customize                |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+--------------------------

Comment (by westonruter):

 @valendesigns: When I tried [attachment:32672.2.diff] I didn't see newly-
 added menus appearing in the nav menu locations' dropdowns because the
 menu `option` would only get added in that `api.bind( 'add' )` call,
 whereas the `api.bind( 'change' )` call is then just updating the existing
 `option`. When a new nav menu is added, it first gets added with an empty
 object `{}` and then right after gets updated to the the full nav menu
 object that is to be created; this ensures it is marked dirty. So the
 `add` callback fires first to inject the new `option` with the placeholder
 ID, and then when the `change` callback fires it supplies the name to the
 `option`.

 I've restored the original `false` check in [attachment:32672.3.diff] and
 I've added a different safeguard for ensuring a string is passed as the
 `name`. Nevertheless, I was not able to reproduce the JS error even
 without making sure `displayNavMenuName` was passed a string. Perhaps the
 JS error was happening before `displayNavMenuName` was introduced in
 [33071].

 If anyone can reproduce the JS error now with this latest path applied to
 trunk, please share the details.

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


More information about the wp-trac mailing list