From: Aaron Schulz Date: Fri, 12 Aug 2011 17:13:28 +0000 (+0000) Subject: Give notice about missing text X-Git-Tag: 1.31.0-rc.0~28312 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=40f792891839e83dacecd8d1dd3830bca2aca2cc;p=lhc%2Fweb%2Fwiklou.git Give notice about missing text --- diff --git a/maintenance/populateRevisionSha1.php b/maintenance/populateRevisionSha1.php index 266b65acc4..ff19cd3adc 100644 --- a/maintenance/populateRevisionSha1.php +++ b/maintenance/populateRevisionSha1.php @@ -26,7 +26,7 @@ class PopulateRevisionSha1 extends Maintenance { public function __construct() { parent::__construct(); $this->mDescription = "Populates the rev_sha1 and ar_sha1 fields"; - $this->setBatchSize( 150 ); + $this->setBatchSize( 200 ); } public function execute() { @@ -78,10 +78,16 @@ class PopulateRevisionSha1 extends Maintenance { } else { $rev = new Revision( $row ); } - $db->update( $table, - array( "{$prefix}_sha1" => Revision::base36Sha1( $rev->getRawText() ) ), - array( $idCol => $row->$idCol ), - __METHOD__ ); + $text = $rev->getRawText(); + if ( !is_string( $text ) ) { + # This should not happen, but sometimes does (bug 20757) + $this->output( "Text of revision {$row->$idCol} unavailable!\n" ); + } else { + $db->update( $table, + array( "{$prefix}_sha1" => Revision::base36Sha1( $text ) ), + array( $idCol => $row->$idCol ), + __METHOD__ ); + } } $db->commit();