r113928 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113927‎ | r113928 | r113929 >
Date:16:09, 15 March 2012
Author:reedy
Status:ok
Tags:
Comment:
Followup r104758

Only ever attempt to process a page once, as the synontm is only used for getting a list of articles to edit (ie it doesn't affect the RefreshLinks part), there's no point processing an article more than once
Modified paths:
  • /trunk/extensions/WikimediaMaintenance/cleanupBug31576.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaMaintenance/cleanupBug31576.php
@@ -2,6 +2,11 @@
33 require_once( dirname( __FILE__ ) . '/WikimediaMaintenance.php' );
44
55 class CleanupBug31576 extends WikimediaMaintenance {
 6+
 7+ protected $batchsize;
 8+
 9+ protected $processed = array();
 10+
611 public function __construct() {
712 parent::__construct();
813 $this->mDescription = "Cleans up templatelinks corruption caused by https://bugzilla.wikimedia.org/show_bug.cgi?id=31576";
@@ -38,15 +43,14 @@
3944 break;
4045 }
4146
42 - $processed = array();
4347 foreach ( $res as $row ) {
4448 $vCount++;
45 - if ( isset( $processed[$row->tl_from] ) ) {
 49+ if ( isset( $this->processed[$row->tl_from] ) ) {
4650 // We've already processed this page, skip it
4751 continue;
4852 }
4953 RefreshLinks::fixLinksFromArticle( $row->tl_from );
50 - $processed[$row->tl_from] = true;
 54+ $this->processed[$row->tl_from] = true;
5155 $pCount++;
5256 }
5357 $this->output( "{$pCount}/{$vCount} pages processed\n" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r113929MFT r113928reedy16:12, 15 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104758Script for cleaning up the mess left behind by bug 31576. Still haven't figur...catrope21:49, 30 November 2011

Status & tagging log