[wpmu-trac] Re: [WordPress MU Trac] #184: wpmu_create_blog Sql Bug

WordPress MU Trac wpmu-trac at lists.automattic.com
Sat Nov 11 07:54:43 GMT 2006


#184: wpmu_create_blog Sql Bug
------------------------+---------------------------------------------------
 Reporter:  abarker     |        Owner:  somebody
     Type:  defect      |       Status:  new     
 Priority:  normal      |    Milestone:  WPMU 1.0
Component:  component1  |      Version:  1.0     
 Severity:  major       |   Resolution:          
 Keywords:              |  
------------------------+---------------------------------------------------
Comment (by ovgray):

 wpmu_create_blog() calls insert_blog(), which calls refresh_blog_details()
 which calls get_blog_details(). get_blog_details() calls get_blog_option()
 in lines 181, 182 and 183 of wpmu-functions.php. Each of those calls
 results in a call to get_option(), which queries the as-yet-uncreated
 options table for the new blog. Error messages are printed because at that
 point $wpdb->show_errors is true.

 $wpdb->show_errors is true at that point because after the call to
 $wpdb->hide_errors() at line 179, switch_to_blog() at line 180 calls
 $wpdb->show_errors(), turning printing of errors back on.

 Although the same calls occur within wpmu_create_blog() when it is called
 from wp-signup.php, the difference is that WP_INSTALLING is defined at the
 beginning of wp-signup.php, which causes error printing to be turned off
 within get_option(). By contrast, wpmu-edit.php does not define
 WP_INSTALLING before calling wpmu_create_blog(), and wpmu_create_blog()
 does not define WP_INSTALLING until after the call to insert_blog().

 There may be a more elegant solution, but reversing the order of the calls
 in lines 179 and 180 of wpmu-functions.php eliminates the error messages.

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/184#comment:1>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list