[wp-trac] [WordPress Trac] #19092: Inactive sidebar box can be on the wrong place in one situation

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 18 16:15:49 UTC 2011


#19092: Inactive sidebar box can be on the wrong place in one situation
--------------------------+-----------------------
 Reporter:  ocean90       |       Owner:  azaozz
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  3.3
Component:  Widgets       |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------

Comment (by azaozz):

 Replying to [comment:15 SergeyBiryukov]:
 > [19332] breaks the sidebars mapping feature. When switching from Twenty
 Eleven to Twenty Ten, all widgets end up as inactive.

 Hmm, don't see that happening. All it does is check whether all currently
 registered sidebars match the stored data for the theme and ignores any
 extra data.

 > Also causes a notice:
 > {{{
 > NOTICE: wp-includes/widgets.php:1244 - Undefined index:
 wp_inactive_widgets
 > }}}

 Seems the notice comes from the fact that 'wp_inactive_widgets' hasn't
 been registered yet. Can add that by hand to `$sidebars`. Strangely didn't
 see that notice while testing.

 > Wouldn't [attachment:19092.patch] be the proper solution here?

 19092.2.patch threats the saved data as "main" and looks for orphaned
 widgets in it. Not sure that's the proper behavior. If the saved data for
 a theme doesn't match the current theme's setup, think we should be
 discarding it, not appending to orphaned.

 User case:
 - Twenty Ten with 5 widgets in each sidebar,
 - user installs theme X with only 4 sidebars leaving 2 orphaned sidebars,
 - after some time user modifies Twenty Ten and enables only 2 sidebars,
 - when activating the modified Twenty Ten, user ends up with 2 orphaned
 sidebars from theme X plus 4 orphaned sidebars from the saved data for
 Twenty Ten, where two of the sidebars are exactly the same as the previous
 orphaned sidebars.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19092#comment:20>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list