https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113928

Revision: 113928
Author:   reedy
Date:     2012-03-15 16:09:39 +0000 (Thu, 15 Mar 2012)
Log Message:
-----------
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: trunk/extensions/WikimediaMaintenance/cleanupBug31576.php
===================================================================
--- trunk/extensions/WikimediaMaintenance/cleanupBug31576.php   2012-03-15 
15:59:15 UTC (rev 113927)
+++ trunk/extensions/WikimediaMaintenance/cleanupBug31576.php   2012-03-15 
16:09:39 UTC (rev 113928)
@@ -2,6 +2,11 @@
 require_once( dirname( __FILE__ ) . '/WikimediaMaintenance.php' );
 
 class CleanupBug31576 extends WikimediaMaintenance {
+
+       protected $batchsize;
+
+       protected $processed = array();
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Cleans up templatelinks corruption 
caused by https://bugzilla.wikimedia.org/show_bug.cgi?id=31576";;
@@ -38,15 +43,14 @@
                                break;
                        }
 
-                       $processed = array();
                        foreach ( $res as $row ) {
                                $vCount++;
-                               if ( isset( $processed[$row->tl_from] ) ) {
+                               if ( isset( $this->processed[$row->tl_from] ) ) 
{
                                        // We've already processed this page, 
skip it
                                        continue;
                                }
                                RefreshLinks::fixLinksFromArticle( 
$row->tl_from );
-                               $processed[$row->tl_from] = true;
+                               $this->processed[$row->tl_from] = true;
                                $pCount++;
                        }
                        $this->output( "{$pCount}/{$vCount} pages processed\n" 
);


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to