From 41aa27cf8c7c1a5e3b20fc6d2536fd8840dd5eff Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 23 May 2012 13:18:57 -0700 Subject: [PATCH] Work around annoying Revision::newFromArchiveRow exception. Change-Id: Ib5cfae54b12fd2fee5120d7dbae7a1e2b99b0181 --- maintenance/populateRevisionSha1.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/maintenance/populateRevisionSha1.php b/maintenance/populateRevisionSha1.php index 6125fc0831..2266a3fd33 100644 --- a/maintenance/populateRevisionSha1.php +++ b/maintenance/populateRevisionSha1.php @@ -145,7 +145,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { $db->update( $table, array( "{$prefix}_sha1" => Revision::base36Sha1( $text ) ), array( $idCol => $row->$idCol ), - __METHOD__ + __METHOD__ ); return true; } @@ -157,7 +157,11 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { */ protected function upgradeLegacyArchiveRow( $row ) { $db = $this->getDB( DB_MASTER ); - $rev = Revision::newFromArchiveRow( $row ); + try { + $rev = Revision::newFromArchiveRow( $row ); + } catch ( MWException $e ) { + return false; // bug 22624? + } $text = $rev->getRawText(); if ( !is_string( $text ) ) { # This should not happen, but sometimes does (bug 20757) @@ -174,7 +178,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { 'ar_timestamp' => $row->ar_timestamp, 'ar_len' => $row->ar_len // extra sanity ), - __METHOD__ + __METHOD__ ); return true; } -- 2.20.1