[wp-trac] [WordPress Trac] #31484: Widgets in Customizer during theme preview fail to preview widgets with prior sidebars_widgets theme mod and fail to apply upon activation (was: Widgets appearing in Customizer preview during a theme preview may not correspond to controls in Widgets panel)

WordPress Trac noreply at wordpress.org
Mon Mar 2 00:47:47 UTC 2015


#31484: Widgets in Customizer during theme preview fail to preview widgets with
prior sidebars_widgets theme mod and fail to apply upon activation
--------------------------+-------------------------
 Reporter:  westonruter   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.1.2
Component:  Customize     |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  javascript
--------------------------+-------------------------
Description changed by westonruter:

Old description:

> When testing the new Theme Switcher in the Customizer, I noticed when
> previewing another theme that the widget controls appearing in the
> Widgets panel were sometimes largely appearing as inactive (partially
> transparent) and the widgets appearing in the Customizer preview did not
> correspond to the widget controls I saw in the Widgets pane. In fact, the
> widgets in the Panel reflected the widgets that were actually from the
> previously-cached widgets configuration (via `retrieve_widgets()` and
> stored in the `sidebars_widgets` theme mod), but the widgets appearing in
> the Customizer preview corresponded to the widget configuration in the
> currently-active theme.
>
> The problem was introduced in WordPress 4.1, specifically in r29905 for
> #29983, since we're no longer posting all of the settings from the
> Customizer pane to the preview for performance reasons: only the changed
> (dirty) settings get POSTed to the Preview when it is loaded.
>
> Steps to reproduce:
>
> 1. Activate Twenty Fourteen via the Themes admin page
> 2. Add multiple widgets to each sidebar via the Widgets admin page; let
> them have "2014" in their titles
> 3. Activate Twenty Thirteen via the Themes admin page
> 4. Add multiple widgets to each sidebar (Main Widget Area, Secondary
> Widget Area) via the Widgets admin page; let them have "2013" in their
> titles
> 5. Try switching between Twenty Thirteen and Twenty Fourteen and note
> each theme's respective sidebar configurations.
> 6. Switch back to Twenty Fourteen via the Themes admin page.
> 7. Live-preview the Twenty Thirteen theme either via the Themes admin
> page, or via the new Customizer theme previewer
> 8. Open the Widgets panel and note that the widgets listed are correctly
> those for Twenty Thirteen, but notice in the Preview that the widgets
> from Twenty Fourteen are unexpectedly showing.

New description:

 When testing the new Theme Switcher in the Customizer, I noticed when
 previewing another theme that the widget controls appearing in the Widgets
 panel were sometimes largely appearing as inactive (partially transparent)
 and the widgets appearing in the Customizer preview did not correspond to
 the widget controls I saw in the Widgets pane. In fact, the widgets in the
 Panel reflected the widgets that were actually from the previously-cached
 widgets configuration (via `retrieve_widgets()` and stored in the
 `sidebars_widgets` theme mod), but the widgets appearing in the Customizer
 preview corresponded to the widget configuration in the currently-active
 theme.

 The problem was introduced in WordPress 4.1, specifically in r29905 for
 #29983, since we're no longer posting all of the settings from the
 Customizer pane to the preview for performance reasons: only the changed
 (dirty) settings get POSTed to the Preview when it is loaded.

 Additionally, when attempting to activate the previous theme that had a
 cached widgets configuration in the `sidebars_widgets` theme mod, this
 prior configuration is not getting restored when activating the
 previously-active theme: the sidebar configuration from the current theme
 is overwriting the previous theme's configuration. I believe this is due
 to the `old_sidebars_widgets_data` not being marked as dirty, and so it is
 not being submitted when saving the settings.

 Steps to reproduce:

 1. Activate Twenty Fourteen via the Themes admin page
 2. Add multiple widgets to each sidebar via the Widgets admin page; let
 them have "2014" in their titles
 3. Activate Twenty Thirteen via the Themes admin page
 4. Add multiple widgets to each sidebar (Main Widget Area, Secondary
 Widget Area) via the Widgets admin page; let them have "2013" in their
 titles
 5. Try switching between Twenty Thirteen and Twenty Fourteen and note each
 theme's respective sidebar configurations.
 6. Switch back to Twenty Fourteen via the Themes admin page.
 7. Live-preview the Twenty Thirteen theme either via the Themes admin
 page, or via the new Customizer theme previewer
 8. Open the Widgets panel and note that the widgets listed are correctly
 those for Twenty Thirteen, but notice in the Preview that the widgets from
 Twenty Fourteen are unexpectedly showing.
 9. Press *Save & Activate* when redirected to the frontend with the Twenty
 Thirteen theme active, notice that the Twenty Fourteen widgets are
 incorrectly shown.

 For previous issues related to widgets in the Customizer being lost during
 a theme switch, see #27897.

--

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


More information about the wp-trac mailing list