[wp-trac] [WordPress Trac] #51592: Customizer: Create New Menu is Empty

WordPress Trac noreply at wordpress.org
Mon Oct 26 14:22:46 UTC 2020


#51592: Customizer: Create New Menu is Empty
--------------------------+---------------------
 Reporter:  boldgrid      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.6
Component:  Customize     |     Version:  trunk
 Severity:  blocker       |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+---------------------

Comment (by david.binda):

 My current understanding is that the control rendering is really broken
 due to the changes in Deferred objects, as it has already been mentioned.

 While we are using `.done()` in customizer code, we are also using
 `$.where()` method (see https://build.trac.wordpress.org/browser/trunk/wp-
 includes/js/customize-base.js?rev=48412#L512 ), which was also updated:

 > Breaking change and Feature: jQuery.when() arguments
 > jQuery.when now interprets any input argument with a then method as a
 Promise-compatible "thenable".

 which, IMHO, with changes to `.then()`,

 > Another behavior change required for Promises/A+ compliance is that
 Deferred .then() callbacks are always called **asynchronously**.
 Previously, if a .then() callback was added to a Deferred that was already
 resolved or rejected, the callback would run immediately and
 synchronously.

 (source: https://jquery.com/upgrade-guide/3.0/#breaking-change-and-
 feature-jquery-deferred-is-now-promises-a-compatible )

 means that the timing of when our embed method is being called and when
 the element is appended to the DOM might be slightly different.

 That's why I believe that the `control.renderContent();` should be called
 outside the conditional (see the patch).

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


More information about the wp-trac mailing list