[wp-trac] [WordPress Trac] #9797: Widget will not be shown in case of its id includes upper characters

WordPress Trac wp-trac at lists.automattic.com
Tue May 12 14:42:56 GMT 2009


#9797: Widget will not be shown in case of its id includes upper characters
--------------------------+-------------------------------------------------
 Reporter:  kamiyeye      |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Widgets       |     Version:  2.8       
 Severity:  normal        |    Keywords:  widget    
--------------------------+-------------------------------------------------
 == Pre-requisite: ==
 A widget with its id/id_base includes at least one upper character

 == Repro Steps: ==
 1. Access the back-end page 'Appearance->Widget'

 2. Drag the widget to a sidebar

 3. Simply refresh the page

 == Expected Results: ==
 The widget is shown on that sidebar

 == Actual Results: ==
 The widget isn't shown on that sidebar

 == Cause: ==
 Before a widget is registered ,the field 'id' is lowered, say:
 {{{
 -- line 557,function wp_register_sidebar_widget,file widgets.php---

   $id = strtolower($id);
 }}}

 But 'id' stored in new WP_Widget class is not lowered:

 {{{
 -- line 90, function __construct, file widgets.php-----------------

 $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '',
 strtolower(get_class($this)) ) : $id_base;
 }}}

 I gathered from these that why the widget isn't shown is because no
 widgets with such an id(has some upper characters) found in the registered
 widgets(all ids are lowered), am i right?


 == P.S. ==
 It tooks me several hours on this issue, i reviewed my widget codes again
 and again, every time, couldn't found any fault.I were almost mad before i
 caught the damned issue. Now, it's yours.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9797>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list