From: Reedy Date: Thu, 25 Oct 2012 13:27:49 +0000 (+0100) Subject: Seems we have error conditions where fa_storage_key == '' X-Git-Tag: 1.31.0-rc.0~21858^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=8200b504427836957ee677afdb4fcf4c3c1ef133;p=lhc%2Fweb%2Fwiklou.git Seems we have error conditions where fa_storage_key == '' continue! Change-Id: I28a06bf6a806fd4db44af6822ca3cd93747481fb --- diff --git a/maintenance/populateFilearchiveSha1.php b/maintenance/populateFilearchiveSha1.php index e9baef9aa0..6c57fde622 100644 --- a/maintenance/populateFilearchiveSha1.php +++ b/maintenance/populateFilearchiveSha1.php @@ -49,7 +49,7 @@ class PopulateFilearchiveSha1 extends LoggedUpdateMaintenance { $table = 'filearchive'; $conds = array( 'fa_sha1' => '', 'fa_storage_key IS NOT NULL' ); $this->output( "Populating fa_sha1 field from fa_storage_key\n" ); - $endId = $dbw->selectField( $table, 'MAX(fa_id)', false, __METHOD__ ); + $endId = $dbw->selectField( $table, 'MAX(fa_id)', false, __METHOD__ ); $batchSize = $this->mBatchSize; $done = 0; @@ -65,6 +65,10 @@ class PopulateFilearchiveSha1 extends LoggedUpdateMaintenance { $i = 0; foreach ( $res as $row ) { + if ( $row->fa_storage_key == '' ) { + // Revision was missing pre-deletion + continue; + } $sha1 = LocalRepo::getHashFromKey( $row->fa_storage_key ); $dbw->update( $table, array( 'fa_sha1' => $sha1 ),