[wp-trac] [WordPress Trac] #37890: `WP_Customize_Manager::prepare_setting_validity_for_js()` assumes `$error_data` is array
WordPress Trac
noreply at wordpress.org
Thu Sep 1 06:37:41 UTC 2016
#37890: `WP_Customize_Manager::prepare_setting_validity_for_js()` assumes
`$error_data` is array
--------------------------+--------------------------
Reporter: dlh | Owner: westonruter
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 4.7
Component: Customize | Version: 4.6
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+--------------------------
Changes (by westonruter):
* owner: => westonruter
* status: new => accepted
Comment:
@dlh I've been thinking about this more, and I think perhaps the (my)
initial decision to add `from_sever` to the data sent from the server was
faulty to begin with. It really shouldn't be mutating the data that was
added to the `WP_Error`. What if instead we just add the `from_server`
flag when we process the validities on the client when they are sent from
the server? We could introduce a new `fromServer` property on
`wp.customize.Notification` to represent this concretely.
What do you think of [attachment:37890.2.diff]?
(This also fixes a bug I noticed with regard to the `setting` property
being completely ignored when the setting notification is synced to the
control notifications.)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37890#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list