r59658 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59657‎ | r59658 | r59659 >
Date:13:37, 2 December 2009
Author:freakolowsky
Status:ok
Tags:
Comment:
(bug 18762) both redirects and links fixed if redirects-only switch not present
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/refreshLinks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/refreshLinks.php
@@ -122,10 +122,10 @@
123123 $this->fixLinksFromArticle( $row->page_id );
124124 }
125125 } else {
126 - $this->output( "Refreshing $what table.\n" );
127126 if ( !$end ) {
128127 $end = $dbr->selectField( 'page', 'max(page_id)', false );
129128 }
 129+ $this->output( "Refreshing redirects table.\n" );
130130 $this->output( "Starting from page_id $start of $end.\n" );
131131
132132 for ($id = $start; $id <= $end; $id++) {
@@ -134,10 +134,21 @@
135135 $this->output( "$id\n" );
136136 wfWaitForSlaves( $maxLag );
137137 }
138 - if($redirectsOnly)
139 - $this->fixRedirect( $id );
140 - else
 138+ $this->fixRedirect( $id );
 139+ }
 140+
 141+ if(!$redirectsOnly) {
 142+ $this->output( "Refreshing links table.\n" );
 143+ $this->output( "Starting from page_id $start of $end.\n" );
 144+
 145+ for ($id = $start; $id <= $end; $id++) {
 146+
 147+ if ( !($id % $reportingInterval) ) {
 148+ $this->output( "$id\n" );
 149+ wfWaitForSlaves( $maxLag );
 150+ }
141151 $this->fixLinksFromArticle( $id );
 152+ }
142153 }
143154 }
144155 }
Index: trunk/phase3/RELEASE-NOTES
@@ -658,6 +658,8 @@
659659 * (bug 21679) "Edit block reasons" link at the bottom of Special:Blockip is now
660660 only displayed to the users that have "editinterface" right
661661 * (bug 21740) Attempting to protect a page that doesn't exist (salting) returns "unknown error"
 662+* (bug 18762) both redirects and links get fixed one after another if
 663+ redirects-only switch is not present
662664
663665 == API changes in 1.16 ==
664666

Status & tagging log