Opened 3 years ago
Closed 3 years ago
#12648 closed defect (bug) (duplicate)
Wpmu_create_blog fails if it is called multiple times
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Multisite | Version: | 2.9.2 |
| Severity: | normal | Keywords: | |
| 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.

Patch for wpmu-functions.php