r107623 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107622‎ | r107623 | r107624 >
Date:06:44, 30 December 2011
Author:bawolff
Status:ok (Comments)
Tags:
Comment:
(bug 31469) Make sure tracking category messages expand variables like
{{NAMESPACE}} relative to the Title of the currently being parsed page.

Basically wfMsgForContent expands messages with wrong title while doing linksupdate stuff via job queue. For the broken file tracking category (r86534),Wikipedia folk want to sort the page into different categories based on namespace, and for some namespaces not categorize them at all (After all, a broken file link in a talk namespace is often not a bad thing).

Anyhow, explicitly set the title object for the message using wfMessage. There's probably deeper issues here in regards to why wfMsg et al is using wrong title, but this should fix the immediate issue.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -201,6 +201,9 @@
202202 should be loaded in <head> for proper dependency resolution
203203 * (bug 32702) Removed method Skin::makeGlobalVariablesScript() has been readded
204204 for backward compatibility
 205+* (bug 31469) Make sure tracking category messages expand variables like
 206+ {{NAMESPACE}} relative to correct title.
 207+
205208
206209 === API changes in 1.19 ===
207210 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/includes/parser/Parser.php
@@ -3859,7 +3859,11 @@
38603860 wfDebug( __METHOD__.": Not adding tracking category $msg to special page!\n" );
38613861 return false;
38623862 }
3863 - $cat = wfMsgForContent( $msg );
 3863+ // Important to parse with correct title (bug 31469)
 3864+ $cat = wfMessage( $msg )
 3865+ ->title( $this->getTitle() )
 3866+ ->inContentLanguage()
 3867+ ->text();
38643868
38653869 # Allow tracking categories to be disabled by setting them to "-"
38663870 if ( $cat === '-' ) {

Sign-offs

UserFlagDate
Platonidesinspected21:08, 4 January 2012

Follow-up revisions

RevisionCommit summaryAuthorDate
r107856MFT r107623: fix {{NAMESPACE}} etc. in tracking category name messageststarling23:19, 2 January 2012
r108622MFT r92703, r94131, r100756, r103074, r107623reedy15:04, 11 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86534(bug 23816) Add tracking category for any page with a broken image....bawolff19:43, 20 April 2011

Comments

#Comment by Bawolff (talk | contribs)   06:51, 30 December 2011

I'm tagging this 1.18wmf1 since it seems its wanted on wikipedia ( bugzilla:33413 )

Status & tagging log