[wp-trac] Re: [WordPress Trac] #10300: Optimization in wp_get_sidebars_widgets() corrupts the widgets

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 5 01:14:30 UTC 2009


#10300: Optimization in wp_get_sidebars_widgets() corrupts the widgets
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |        Owner:  azaozz  
     Type:  defect (bug)       |       Status:  reopened
 Priority:  normal             |    Milestone:  2.8.1   
Component:  Widgets            |      Version:  2.8     
 Severity:  normal             |   Resolution:          
 Keywords:  commit blocker     |  
-------------------------------+--------------------------------------------

Comment(by azaozz):

 There are two different workflows here, each with two cases:
  * When upgrading from WordPress 2.2+ (99.9% of the cases?) the widgets'
 settings are converted from single to multi format for most default
 widgets. The conversion happens only in memory on the front-end and is
 saved when the user visits the widgets screen.

  * When upgrading from WordPress <= 2.1 two different conversions have to
 be done and the old widgets plugin has to be disabled (this disables all
 widgets added by it). Then the settings from the old widgets have to be
 converted to the newer (in 2.2) array format and then they have to be
 converted to the new (in 2.8) multi-widget settings format. These steps
 can be performed reliably when the user visits the widgets screen, so
 currently WordPress doesn't run these conversions for the front-end and
 doesn't save the widgets order array from there.

 The widgets order is explicitly saved when the user visits the widgets
 screen either in retrieve_widgets() or when a widget is
 added/moved/deleted. The latter also resets the order array completely.

 Since nothing is saved unless the user visits the widgets screen, plugins
 have the opportunity to manipulate any settings and/or perform a
 conversion before that.

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


More information about the wp-trac mailing list