X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FpopulateRevisionSha1.php;h=1d8e4c8ba6393740c41f827d764efe969ca0fd15;hb=337b0d3b0f94c74df341e57b6dfe355e09090129;hp=d8ff74906c2b3f43ad335144751225540146d8ef;hpb=acf695cea3aaa6560538853925912bd84ca71ed6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateRevisionSha1.php b/maintenance/populateRevisionSha1.php index d8ff74906c..1d8e4c8ba6 100644 --- a/maintenance/populateRevisionSha1.php +++ b/maintenance/populateRevisionSha1.php @@ -132,12 +132,15 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { */ protected function upgradeRow( $row, $table, $idCol, $prefix ) { $db = $this->getDB( DB_MASTER ); - if ( $table === 'archive' ) { - $rev = Revision::newFromArchiveRow( $row ); - } else { - $rev = new Revision( $row ); + try { + $rev = ( $table === 'archive' ) + ? Revision::newFromArchiveRow( $row ) + : new Revision( $row ); + $text = $rev->getRawText(); + } catch ( MWException $e ) { + $this->output( "Text of revision with {$idCol}={$row->$idCol} unavailable!\n" ); + return false; // bug 22624? } - $text = $rev->getRawText(); if ( !is_string( $text ) ) { # This should not happen, but sometimes does (bug 20757) $this->output( "Text of revision with {$idCol}={$row->$idCol} unavailable!\n" ); @@ -161,6 +164,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { try { $rev = Revision::newFromArchiveRow( $row ); } catch ( MWException $e ) { + $this->output( "Text of revision with timestamp {$row->ar_timestamp} unavailable!\n" ); return false; // bug 22624? } $text = $rev->getRawText();