WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#41361 closed defect (bug) (fixed)

Text widget can raise JS error if customize-base is enqueued on widgets admin screen

Reported by: westonruter Owned by: westonruter
Milestone: 4.8.1 Priority: normal
Severity: normal Version: 4.8
Component: Widgets Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

The Text widget is currently looking for wp.customize before attempting to interact with wp.customize.state. However, the state object is only present in the Customizer app when customize-controls is enqueued. If customize-base alone is enqueued, the wp.customize object will exist but the wp.customize.state object will not. This results in an error when the Text widget's triggerChangeIfDirty logic runs.

Attachments (1)

41361.0.diff (744 bytes) - added by westonruter 4 months ago.

Download all attachments as: .zip

Change History (5)

@westonruter
4 months ago

#1 @westonruter
4 months ago

  • Keywords has-patch commit added
  • Owner set to westonruter
  • Status changed from new to accepted

#2 @westonruter
4 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 41088:

Widgets: Check for existence of wp.customize.state before attempting to access in Text widget.

Amends [40631].
See #35243.
Fixes #41361 for trunk.

#3 @westonruter
4 months ago

  • Keywords fixed-major added

#4 @westonruter
4 months ago

In 41089:

Widgets: Check for existence of wp.customize.state before attempting to access in Text widget.

Merges [41088] onto 4.8 branch.
Amends [40631].
See #35243.
Fixes #41361 for 4.8.1.

Note: See TracTickets for help on using tickets.