Adding a new site in multisite throw a "could not create site" error
|Reported by:||crossingsquirrel||Owned by:|
Description (last modified by SergeyBiryukov)
When adding a new site in a multisite install I always get "could not create site". I experienced this in the italian release of 3.5.2, but the following code is the same for both english and italian releases.
Digging around I found a solution to this:
In wp-include/ms-functions.php, at row 1114 I've changed this
refresh_blog_details($wpdb->insert_id); return $wpdb->insert_id;
$blog_id = $wpdb->insert_id; refresh_blog_details($blog_id); return $blog_id;
and it solved the issue, somehow it feels like that $wpdb->insert_id returns 0 after refresh_blog_details is called. And since the function calling insert_blog(...) is testing against a false, without test for type, the 0 trigger the error.
CentOs 6.4 64bit
Nginx and php-fpm from epel extra repository
mysql from official repository
I don't known if this issue is related to my server being on a VPS cloud but I had the same issue with two different vps solutions from two different companies.
Change History (5)
comment:1 follow-up: ↓ 2 SergeyBiryukov — 6 months ago
- Description modified (diff)
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Severity changed from blocker to normal
- Status changed from new to closed
- Version changed from 3.5.2 to 3.0