Opened 9 years ago
Closed 9 years ago
#36660 closed defect (bug) (fixed)
WP_Customize_Widgets::preview_sidebars_widgets() can return false
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.5.3 | Priority: | normal |
Severity: | normal | Version: | 4.5 |
Component: | Customize | Keywords: | has-patch commit fixed-major |
Focuses: | Cc: |
Description
Seeing this PHP notice on dotorg:
E_WARNING: /wp-includes/class-wp-customize-widgets.php:385 - array_merge(): Argument #3 is not an array array_merge(): Argument #3 is not an array Timestamp: Mon, 25 Apr 2016 08:52:29 +0000 (1461574349) File: /wp-includes/class-wp-customize-widgets.php Line: 385
This seems to be caused by [37166] where the sidebars_widgets
callback was moved before the wp_get_sidebars_widgets()
call.
WP_Customize_Widgets::preview_sidebars_widgets()
is using get_option( 'sidebars_widgets' )
without defining a default value so it falls back to false
in case the site has no widgets.
Attachments (2)
Change History (10)
#2
@
9 years ago
- Keywords commit added
- Owner set to westonruter
- Status changed from new to reviewing
Added unit test in 36660.2.diff to verify the fix. Without the patch, the unit test fails with:
1) Tests_WP_Customize_Widgets::test_customize_register_with_deleted_sidebars array_merge(): Argument #3 is not an array src/wp-includes/class-wp-customize-widgets.php:385 tests/phpunit/tests/customize/widgets.php:112
#4
@
9 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Re-opening for 4.5.2 consideration.
This ticket was mentioned in Slack in #core by adamsilverstein. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
Related: #27965 (Error in theme customizer if all widget areas are empty)