Widgets move to Inactive after clearing all widgets from sidebars
|Reported by:||lancewillett||Owned by:|
Jane reported in IRC that a theme switch dropped her widgets to Inactive.
Jane: test site had 2010 as theme, with some widgets. activated 2011 on themes.php. Refreshed itself to themes.php?activated=true and showed alert message " New theme activated. This theme supports widgets, please visit the widgets settings screen to configure them." Go to widgets screen, widgets in primary sidebar in 2010 are not in sidebar, no widgets live anymore
Jane: switch back to 2010, same message appears on themes.php?activated=true and 2010 sidebar comes back
I was able to repeat the reported issue one only one specific case.
This only happens if you remove *all* widgets from all sidebars. Then add widgets back to sidebar(s). Then, switch back to a previously activated theme.
- It doesn't happen if you leave at least one widget in place in a sidebar
- It doesn't happen if you switch to a new theme (not previously activated)
Looks like we can solve it by the "lost" widget check just puts any old widgets into Inactive. We should orphan those, too.
To fix: If widgets registered but not in the new theme's sidebar, orphan it.