From: Chad Horohoe Date: Tue, 1 Mar 2011 17:16:45 +0000 (+0000) Subject: Skip site stats insertion if theres already a row. Happens if install fails part... X-Git-Tag: 1.31.0-rc.0~31704 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=d382f7be381e26ff4c1cf60149ad671241034b76;p=lhc%2Fweb%2Fwiklou.git Skip site stats insertion if theres already a row. Happens if install fails part-way and then reattempts --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 013ce6c5c0..b812ad72c3 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -562,15 +562,18 @@ abstract class Installer { if ( !$status->isOK() ) { return $status; } - $status->value->insert( 'site_stats', array( - 'ss_row_id' => 1, - 'ss_total_views' => 0, - 'ss_total_edits' => 0, - 'ss_good_articles' => 0, - 'ss_total_pages' => 0, - 'ss_users' => 0, - 'ss_admins' => 0, - 'ss_images' => 0 ) ); + if( !$status->value->selectField( 'site_stats', 'ss_row_id' ) ) { + $status->value->insert( 'site_stats', array( + 'ss_row_id' => 1, + 'ss_total_views' => 0, + 'ss_total_edits' => 0, + 'ss_good_articles' => 0, + 'ss_total_pages' => 0, + 'ss_users' => 0, + 'ss_images' => 0 ) + ); + } + return Status::newGood(); }