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

WordPress Trac noreply at wordpress.org
Fri Sep 2 22:34:50 UTC 2016


#37890: `WP_Customize_Manager::prepare_setting_validity_for_js()` assumes
`$error_data` is array
--------------------------+--------------------------
 Reporter:  dlh           |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.7
Component:  Customize     |     Version:  4.6
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"38513"]:
 {{{
 #!CommitTicketReference repository="" revision="38513"
 Customize: Fix php warning due to
 `WP_Customize_Manager::prepare_setting_validity_for_js()` incorrectly
 assuming that `WP_Error` will only ever have arrays in its `$error_data`.

 * Eliminates the server mutating the a `WP_Error`'s `$error_data` to
 merge-in a `$from_server` flag (since it may not be an array to begin
 with). Instead it defers to the client to add a `fromServer` param on any
 `Notification` instances created from server-sent errors.
 * Ensures that notifications will be re-rendered if a notification's
 `message` changes but the `data` and `type` remain the same.
 * Adds explicit support for the `Notification` class to have a `setting`
 property, ensuring that the property is set whereas previously it was
 dropped.

 Fixes #37890.
 Props westonruter, dlh.
 }}}

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


More information about the wp-trac mailing list