[wp-trac] [WordPress Trac] #41621: Customize: Removing setting from changeset generates PHP warning
WordPress Trac
noreply at wordpress.org
Sat Aug 12 20:40:40 UTC 2017
#41621: Customize: Removing setting from changeset generates PHP warning
--------------------------+-----------------------------
Reporter: dlh | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.7
Severity: normal | Keywords: has-patch
Focuses: |
--------------------------+-----------------------------
`WP_Customize_Manager::save_changeset_post()` includes a check for
`array_key_exists( 'value', $setting_params )` while looping through
`$args['data']`.
This check can generate a warning when removing a setting from the
changeset by passing `'setting_id' => null`.
The attached patch includes a PHPUnit test demonstrating the issue; it
should also be replicable in JS by calling
`wp.customize.requestChangesetUpdate( { 'setting_id': null } )`.
The patch would verify that `$setting_params` is an array before checking
`array_key_exists()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41621>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list