[wp-trac] [WordPress Trac] #10954: Widgets Disappear

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 20 09:25:35 UTC 2009


#10954: Widgets Disappear
--------------------------+-------------------------------------------------
 Reporter:  hakre         |       Owner:  azaozz       
     Type:  defect (bug)  |      Status:  new          
 Priority:  normal        |   Milestone:  2.9          
Component:  Widgets       |     Version:  2.8.4        
 Severity:  normal        |    Keywords:  needs-testing
--------------------------+-------------------------------------------------

Comment(by hakre):

 I do not understand why everything is made so complicated to just fix it.
 In the current code, the first if checking for is numeric might not be the
 holy grail but a patch only needs to take care in times it fails. that
 ensures that at least every widget in the factory is displayed on screen.
 Fixed. That was what my patch is doing.

 There isn't even much testing because a) not much has been changed and b)
 there is no complicated logic changes.

 I know that this whole area has big deficies and I'm pretty sure that a
 refactored component needs a lot of testing but this is not what my patch
 was about. It was just about fixing.

 And please don't touch a users data. As azzoz and others already pointed
 out, we just do not know what is saved in that option because it's an
 array.

 To make the data structure / stored data more robust, we might consider
 about changing from numerical indezies to prefixed ones like:

 {{{
 $optiondata = array(
   'wp_bogusoptions' => 'MY SUPERPLUGIN in 2.5 MADE IT, YEAH!',
   'wp_widget-data-0' => array(/* widget options for widget number #1 */),
   'wp_widget-data-1' => array(/* widget options for widget number #2 */),
   'wp_widget-data-2' => array(/* widget options for widget number #1 */),
   'widgetpluginsname' => array(/* some plugin did store stuff here for
 this widget-type */),
 )
 }}}

 Just a suggestion. In case there are no options we must still use the
 fallback as it is intended right now with the current check for numerical
 values only.

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


More information about the wp-trac mailing list