[wp-trac] [WordPress Trac] #37890: `WP_Customize_Manager::prepare_setting_validity_for_js()` assumes `$error_data` is array

WordPress Trac noreply at wordpress.org
Tue Aug 30 21:27:01 UTC 2016


#37890: `WP_Customize_Manager::prepare_setting_validity_for_js()` assumes
`$error_data` is array
--------------------------+-----------------------------
 Reporter:  dlh           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Previously discussed in Slack: https://wordpress.slack.com/archives/core-
 customize/p1472276384000282

 @westonruter proposed two patches in that discussion to address the issue,
 both of which work fine in my testing. I can't yet come up with an
 overwhelming reason to choose one approach over the other.

 Still, the attached patch goes with the first option, which seems more
 faithful to the original `$data` added to the `WP_Error`. It also seems to
 avoid an inconsistency where `WP_Error` data that ''is'' an array is
 placed alongside `from_server => true` but non-array data isn't, although
 that behavior might be desirable in a scenario I missed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37890>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list