[wp-trac] [WordPress Trac] #32856: wpColorPicker close should check that iris hasn't been destroyed before toggling it.
WordPress Trac
noreply at wordpress.org
Wed Jul 1 14:40:26 UTC 2015
#32856: wpColorPicker close should check that iris hasn't been destroyed before
toggling it.
--------------------------+-----------------------------
Reporter: gitlost | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.2.2
Severity: normal | Keywords:
Focuses: javascript |
--------------------------+-----------------------------
wpColorPicker.close() can be called (via the 'click.wpcolorpicker' event
on body) when the internally used iris widget has already been destroyed,
which means that when it attempts to toggle iris an exception is thrown.
The attached patch just checks that iris still exists before the toggle is
attempted.
This issue arose in response to the question "Modify Custom Field in Media
Library using JavaScript" by @Howdy_McGee on Wordpress Development
stackexchange http://wordpress.stackexchange.com/questions/193006/modify-
custom-field-in-media-library-using-javascript, which can be used to
replicate the scenario. If you open the color picker and then, leaving it
open, close the Attachment Details modal window, a $.error exception is
thrown (or can be - may depend on your system) by jQuery UI Widget,
"cannot call methods on iris prior to initialization".
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32856>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list