[wp-trac] [WordPress Trac] #24697: Adding a new site in multisite throw a "could not create site" error

WordPress Trac noreply at wordpress.org
Sat Jul 6 07:25:06 UTC 2013


#24697: Adding a new site in multisite throw a "could not create site" error
------------------------------+-----------------------------
 Reporter:  crossingsquirrel  |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Multisite         |    Version:  3.5.2
 Severity:  blocker           |   Keywords:  has-patch
------------------------------+-----------------------------
 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;

 into this

    $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.

 Server info:
 CentOs 6.4 64bit
 Nginx and php-fpm from epel extra repository
 mysql from official repository

 Notes:
 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.

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


More information about the wp-trac mailing list