[wp-trac] [WordPress Trac] #43331: Color picker breaks admin panel in many templates

WordPress Trac noreply at wordpress.org
Sat Feb 17 17:59:58 UTC 2018


#43331: Color picker breaks admin panel in many templates
---------------------------------------+--------------------
 Reporter:  grzecho                    |       Owner:
     Type:  defect (bug)               |      Status:  new
 Priority:  normal                     |   Milestone:  4.9.5
Component:  Administration             |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  has-screenshots has-patch  |     Focuses:
---------------------------------------+--------------------
Changes (by afercia):

 * keywords:  reporter-feedback => has-screenshots has-patch
 * milestone:  Awaiting Review => 4.9.5


Comment:

 I think the only thing that can be done here is to try to avoid the JS
 error, see [attachment:43331.diff].

 However, I'm not sure this should be done in the first place. Plugins that
 overwrite some of the color picker methods should take care to update
 their code when a change in core happens. These methods are not guaranteed
 to be backwards compatible and plugins that overwrite them, they basically
 do that at their own risk. In these cases, I'd tend to think the best
 option for users is to always update plugins to newer versions that fix
 compatibility issues.

 As far as I can see, this old version of Avada, specifically the fusion
 builder plugin, called the color picker widget `close` method (which
 changed in 4.9) but it was still using a custom, not updated, version of
 the `_create` method which apparently doesn't set `this.inputWrapper`.

 The patch initially sets `this.inputWrapper` to an empty jQuery object,
 thus avoiding JS errors when later calling jQuery methods on it. This
 doesn't guarantee the color picker will work correctly when plugins
 overwrite the `_create` method though. Also, following this logic, other
 objects are not guaranteed to exist, for example the `wrap`, `toggler`,
 and `button` ones: should the color picker worry about them too? Honestly,
 I don't think it should.

 Moving to 4.9.5 consideration, but I'd recommend to consider if this is
 really necessary first.

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


More information about the wp-trac mailing list