[wp-trac] [WordPress Trac] #19291: Widgets move to Inactive after clearing all widgets from sidebars

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 18 18:48:08 UTC 2011


#19291: Widgets move to Inactive after clearing all widgets from sidebars
------------------------------+------------------------------
 Reporter:  lancewillett      |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Warnings/Notices  |     Version:  3.3
 Severity:  normal            |  Resolution:
 Keywords:                    |
------------------------------+------------------------------

Comment (by azaozz):

 Replying to [comment:5 lancewillett]:
 > This is what Aaron and I set out to do in #17979. We're treating the
 saved data as canonical, and moving anything else to Orphaned widgets.
 >
 > So the patch is correct in that sense.

 Then we should expire that data at some point. If a week is too short,
 perhaps a month?

 > Replying to [comment:4 azaozz]:
 > > In that case IMHO we should be adding all of the newly added widgets
 to Inactive Widgets.
 >
 > Please, no. :)
 >
 > We want to avoid moving anything to Inactive if possible. Remap to new
 sidebar is 1st priority, which works in all cases but this one.
 >
 > Second priority is to move to Orphaned.
 >
 > My goal is to not ever see anything in Inactive unless a user moves it
 there.

 Unfortunately this ends up happening with 19092.2.patch too. New widgets
 instances end up in Inactive as we treat the old saved data as
 main/canonical.

 All widgets that were added after the themes have been switched end up in
 Inactive. In fact if we expire the saved data (after some time) the
 currently used widgets are matched better to the old theme's sidebars.

 Not sure what would be the best thing to do. Looking at individual widget
 instances is not the answer, perhaps we could compare the current data
 with the saved data and append any newly added widgets to the sidebars
 that match the positions? I.e. when looking for extra widgets instances we
 honor their position in the previous theme although they aren't in the
 saved data.

 So, new data:
 - sidebar A has 7 widgets, 3 old and 4 new,
 - sidebar B has 3 widgets, all old,
 - sidebar C has 1 widget, new.

 Saved data:
 - sidebar A has 2 widgets that match 2 of the 3 above,
 - sidebar B has 3 widgets that match the 3 above,
 - sidebar C has 3 widgets, all missing,
 - sidebar D has 2 widgets, 1 in sidebar A above, 1 in Inactive,
 - sidebar E has 1 widget, missing.

 After restoring the saved data we end up with:
 - sidebar A has 2 widgets out of the 7 that were there in the previous
 theme,
 - sidebar B has 3 widgets that match the 3 previous,
 - sidebar C has 0 widgets,
 - sidebar D has 2 widgets, 1 from the previous sidebar A,
 - sidebar E has 0 widgets,
 - Inactive Widgets have 4 widgets that weren't in the saved data.

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


More information about the wp-trac mailing list