Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#12648 closed defect (bug) (duplicate)

Wpmu_create_blog fails if it is called multiple times

Reported by: jpotkanski's profile jpotkanski Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9.2
Component: Multisite Keywords:
Focuses: Cc:

Description

Test:
ids[] = wpmu_create_blog($current_site->domain, '/test1/', 'Test Blog 1', 1, array( "public" => 0 ), $current_site->id);
ids[] = wpmu_create_blog($current_site->domain, '/test2/', 'Test Blog 2', 1, array( "public" => 0 ), $current_site->id);
ids[] = wpmu_create_blog($current_site->domain, '/test3/', 'Test Blog 3', 1, array( "public" => 0 ), $current_site->id);

Test Blog 1 will create fine.

Test Blog 2 and 3 will be properly created in wp_blogs but will not have their local specific tables created.

The bug is in the design of require_once upgrade.php in the install_blog function. Deep underneath this sets a global $wp_queries. Long term, the global $wp_queries NEEDS to be deprecated in favor of a function.

The patch will regex replace the correct blog id if $wp_queries exists.

Attachments (1)

wpmu-create-blog.patch (1.1 KB) - added by jpotkanski 14 years ago.
Patch for wpmu-functions.php

Download all attachments as: .zip

Change History (2)

@jpotkanski
14 years ago

Patch for wpmu-functions.php

#1 @ryan
14 years ago

  • Milestone 2.9.3 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

See #12028

Note: See TracTickets for help on using tickets.