[wp-hackers] WPMU install_blog() "Already Installed" and ID increment checking

Raphaël Droz raphael.droz at gmail.com
Tue Mar 23 16:20:49 UTC 2010

I've experienced a very strange and apparently unpredictable error :
In wp-includes/wpmu-functions.php : install_blog() :
"Blog already installed".

I found the reason of that message, I think blog creation routine may be 
robust then.

I had old blog tables from previous experiences (and a rsync without 
--delete kept
them) but I had restored a fresh mysql DB.
When the blog is created its content is checked :
    if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") )
But if you have old tables laying around, its *their* content which will be
taken into account.
So my point is that before checking the content of a freshly created blog,
its ID should be checked first, probably in insert_blog around 
If the table already exists, find another ID, or fail.


More information about the wp-hackers mailing list