(bug 18762) both redirects and links fixed if redirects-only switch not present
authorJure Kajzer <freakolowsky@users.mediawiki.org>
Wed, 2 Dec 2009 13:37:24 +0000 (13:37 +0000)
committerJure Kajzer <freakolowsky@users.mediawiki.org>
Wed, 2 Dec 2009 13:37:24 +0000 (13:37 +0000)
RELEASE-NOTES
maintenance/refreshLinks.php

index b73b43e..b411ed1 100644 (file)
@@ -658,6 +658,8 @@ Hopefully we will remove this configuration var soon)
 * (bug 21679) "Edit block reasons" link at the bottom of Special:Blockip is now
   only displayed to the users that have "editinterface" right
 * (bug 21740) Attempting to protect a page that doesn't exist (salting) returns "unknown error"
+* (bug 18762) both redirects and links get fixed one after another if 
+  redirects-only switch is not present
 
 == API changes in 1.16 ==
 
index 58c789c..c75554e 100644 (file)
@@ -122,10 +122,10 @@ class RefreshLinks extends Maintenance {
                                        $this->fixLinksFromArticle( $row->page_id );
                        }
                } else {
-                       $this->output( "Refreshing $what table.\n" );
                        if ( !$end ) {
                                $end = $dbr->selectField( 'page', 'max(page_id)', false );
                        }
+                       $this->output( "Refreshing redirects table.\n" );
                        $this->output( "Starting from page_id $start of $end.\n" );
        
                        for ($id = $start; $id <= $end; $id++) {
@@ -134,10 +134,21 @@ class RefreshLinks extends Maintenance {
                                        $this->output( "$id\n" );
                                        wfWaitForSlaves( $maxLag );
                                }
-                               if($redirectsOnly)
-                                       $this->fixRedirect( $id );
-                               else
+                               $this->fixRedirect( $id );
+                       }
+
+                       if(!$redirectsOnly) {
+                               $this->output( "Refreshing links table.\n" );
+                               $this->output( "Starting from page_id $start of $end.\n" );
+
+                               for ($id = $start; $id <= $end; $id++) {
+       
+                                       if ( !($id % $reportingInterval) ) {
+                                               $this->output( "$id\n" );
+                                               wfWaitForSlaves( $maxLag );
+                                       }
                                        $this->fixLinksFromArticle( $id );
+                               }
                        }
                }
        }