r91059 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91058‎ | r91059 | r91060 >
Date:07:19, 29 June 2011
Author:bawolff
Status:resolved (Comments)
Tags:
Comment:
BacklinkCache was forgetting to check rd_interwiki when getting redirects, and thus getting
some extranous backlinks for the redirect table (if there happened to be a page redirecting
to an interwiki page with the same name plus an interwiki prefix).

Not a major issue since this is really only used as far as i can tell, to purge squids and html file cache.
A couple of extra unneeded purges shouldn't hurt anything, just a bit pointless.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/BacklinkCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -130,6 +130,8 @@
131131 * Use content language in formatting of dates in revertpage message
132132 (rollback revert edit summary) and do not adjust for user timezone.
133133 * (bug 29277) MediaWiki:Filepage.css is also shown on the local wiki
 134+* Make sure Backlink cache does not retrieve interwiki redirects when looking for
 135+ redirects to a local page.
134136
135137 === API changes in 1.19 ===
136138 * BREAKING CHANGE: action=watch now requires POST and token.
Index: trunk/phase3/includes/BacklinkCache.php
@@ -207,10 +207,17 @@
208208 switch ( $table ) {
209209 case 'pagelinks':
210210 case 'templatelinks':
 211+ $conds = array(
 212+ "{$prefix}_namespace" => $this->title->getNamespace(),
 213+ "{$prefix}_title" => $this->title->getDBkey(),
 214+ "page_id={$prefix}_from"
 215+ );
 216+ break;
211217 case 'redirect':
212218 $conds = array(
213219 "{$prefix}_namespace" => $this->title->getNamespace(),
214220 "{$prefix}_title" => $this->title->getDBkey(),
 221+ "{$prefix}_interwiki" => '',
215222 "page_id={$prefix}_from"
216223 );
217224 break;

Sign-offs

UserFlagDate
Catropeinspected09:13, 29 June 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r91138(Follow-up r91059) Make backlinks query do both null or "" to potentially acc...bawolff23:09, 29 June 2011

Comments

#Comment by Nikerabbit (talk | contribs)   07:33, 29 June 2011

Just curious, how long has this bug been there?

#Comment by Bawolff (talk | contribs)   17:45, 29 June 2011

Since 1.16 - r69181

One thing, looking at r69181 just now it appears that the redirect table could have nulls in it during the time right after its added. I'm not sure if I should change the where condition to be rd_interwiki = or rd_interwiki is null? Or does it matter since the table was added three versions ago and old entries are updated on page view, so there really should not be any nulls left(?)

#Comment by Catrope (talk | contribs)   19:14, 29 June 2011

Yeah I think you should check for nulls just to be sure. IIRC we're still not populating these fields properly on WMF.

Status & tagging log