[wp-trac] [WordPress Trac] #42274: preview_sidebars_widgets unsetting $sidebars_widgets['array_version'] without check

WordPress Trac noreply at wordpress.org
Thu Oct 19 18:21:09 UTC 2017


#42274: preview_sidebars_widgets unsetting $sidebars_widgets['array_version']
without check
-------------------------------+------------------------------
 Reporter:  darrencoutts       |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by westonruter):

 * keywords:   => reporter-feedback


Old description:

> preview_sidebars_widgets unsets $sidebars_widgets['array_version']
> without checking that it is ever set in the first place.
>
> Granted that it should be, however if a developer wants to remove all
> widgets from their site, it is possible that they will clear them from a
> database, a database may be corrupted, or a plugin/theme sets this option
> by mistake.
>
> Suggest that this should have a conditional check to ensure that
> $sidebars_widgets['array_version'] is actually set and also ensure that
> this function always returns an array, even if the database has been
> emptied.

New description:

 `WP_Customize_Widgets::preview_sidebars_widgets()` unsets
 `$sidebars_widgets['array_version']` without checking that it is ever set
 in the first place.

 Granted that it should be, however if a developer wants to remove all
 widgets from their site, it is possible that they will clear them from a
 database, a database may be corrupted, or a plugin/theme sets this option
 by mistake.

 Suggest that this should have a conditional check to ensure that
 $sidebars_widgets['array_version'] is actually set and also ensure that
 this function always returns an array, even if the database has been
 emptied.

--

Comment:

 @darrencoutts thanks for the report. Is this related to #27965?

 Would you also clarify what you mean by emptying the database? Steps to
 reproduce the problem would be helpful.

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


More information about the wp-trac mailing list