Merge "Work around annoying Revision::newFromArchiveRow exception."
authorBrion VIBBER <brion@wikimedia.org>
Thu, 24 May 2012 18:48:38 +0000 (18:48 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 24 May 2012 18:48:38 +0000 (18:48 +0000)
1  2 
maintenance/populateRevisionSha1.php

@@@ -102,8 -102,7 +102,8 @@@ class PopulateRevisionSha1 extends Logg
        protected function doSha1LegacyUpdates() {
                $count = 0;
                $db = $this->getDB( DB_MASTER );
 -              $res = $db->select( 'archive', '*', array( 'ar_rev_id IS NULL' ), __METHOD__ );
 +              $res = $db->select( 'archive', '*',
 +                      array( 'ar_rev_id IS NULL', 'ar_sha1' => '' ), __METHOD__ );
  
                $updateSize = 0;
                $db->begin( __METHOD__ );
         */
        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)