[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 08:07:35 UTC 2013


#24697: Adding a new site in multisite throw a "could not create site" error
------------------------------+------------------------
 Reporter:  crossingsquirrel  |       Owner:
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:
Component:  Multisite         |     Version:  3.0
 Severity:  normal            |  Resolution:  duplicate
 Keywords:  has-patch         |
------------------------------+------------------------
Changes (by SergeyBiryukov):

 * status:  new => closed
 * severity:  blocker => normal
 * version:  3.5.2 => 3.0
 * milestone:  Awaiting Review =>
 * resolution:   => duplicate


Old description:

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

New description:

 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.

--

Comment:

 Duplicate of #23400.

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


More information about the wp-trac mailing list