[wp-trac] [WordPress Trac] #32814: Custom Menu Widget should show newly added menus in Customizer

WordPress Trac noreply at wordpress.org
Wed Jul 1 17:15:52 UTC 2015

#32814: Custom Menu Widget should show newly added menus in Customizer
 Reporter:  adamsilverstein           |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.3
Component:  Customize                 |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  needs-patch dev-feedback  |     Focuses:  javascript
Changes (by adamsilverstein):

 * keywords:  needs-patch => needs-patch dev-feedback


 I've noticed another issue while working on this: despite the fact that
 the new menu is added to custom menu widget options, selecting it doesn't
 work. Instead, when i select a newly created menu I am seeing a console
 error: `Uncaught TypeError: Cannot read property 'active' of undefined` as
 well as an ajax callback failure.

 The ajax callback is trying to get the menu data from the server
 (rendering the widget), and i believe its not there yet, so we likely need
 to either temporarily save it there, or better yet adjust the logic to
 recognize this is a new item, and use the local data.

 The ajax request: http://cl.ly/image/3O2C2J1a2E42

 in addition, I'm seeing PHP warnings in the preview when this callback

 '''This hole keeps getting bigger the more i dig! '''

 Thinking we should consider taking a step back and using a different
 approach. We could skip adding the menu to the widgets for now, instead
 adding a notice informing users in the widget itself that they need to
 save and publish the new menu before it will be available to the widget.

 This solves all the issues in one step, and really doesn't reduce the
 functionality: the user can create and save a menu, the still non-
 destructively try assigning that menu item to a custom widget area before
 saving that change.

 Feedback welcome :)

Ticket URL: <https://core.trac.wordpress.org/ticket/32814#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list