Opened 10 years ago
Closed 10 years ago
#36660 closed defect (bug) (fixed)
WP_Customize_Widgets::preview_sidebars_widgets() can return false
| Reported by: | ocean90 | Owned by: | ocean90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5.3 |
| Component: | Customize | Version: | 4.5 |
| Severity: | normal | Keywords: | has-patch commit fixed-major |
| Cc: | Focuses: |
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
@
10 years ago
- Keywords commit added
- Owner set to
- Status new → 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
This ticket was mentioned in Slack in #core by adamsilverstein. View the logs.
10 years ago
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #27965 (Error in theme customizer if all widget areas are empty)