[wp-trac] [WordPress Trac] #16913: install_blog() does not work correctly when called multiple times

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 21 11:05:22 UTC 2011


#16913: install_blog() does not work correctly when called multiple times
--------------------------+-----------------------------
 Reporter:  westi         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Multisite     |    Version:  3.1
 Severity:  major         |   Keywords:  needs-patch
--------------------------+-----------------------------
 If you want to pre-populate your multisite network with a big group of new
 blogs to streamline importing from another multisite CMS or another
 multisite install you can't create a single php script to pre-create all
 the blogs and there tables.

 Something like this will create the blogs in {{{wp_blogs}}} but only
 install the tables for the first blog due to the way the table schemas are
 calculate at include time.

 {{{
 function wp_footer_hooked() {
         $new_blog_id = wpmu_create_blog( 'importone.multisite.domain', '',
 'Import One', 1 );
         $new_blog_id = wpmu_create_blog( 'importtwo.multisite.domain', '',
 'Import Two', 1 );
 }
 add_action('wp_footer', 'wp_footer_hooked');
 }}}

 I think the best fix for this is to change wp-admin/includes/schema.php to
 return the schema info via a functions rather than at include time (for
 back compat we can still set the global var up but not use it in core)

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


More information about the wp-trac mailing list