From: Brian Wolff Date: Fri, 30 Dec 2011 06:44:38 +0000 (+0000) Subject: (bug 31469) Make sure tracking category messages expand variables like X-Git-Tag: 1.31.0-rc.0~25679 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=770cd71b510269b8b2f2d7cb3c7101343352e517;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 5e39e81089..a1bac754f8 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -201,6 +201,9 @@ production. should be loaded in for proper dependency resolution * (bug 32702) Removed method Skin::makeGlobalVariablesScript() has been readded for backward compatibility +* (bug 31469) Make sure tracking category messages expand variables like + {{NAMESPACE}} relative to correct title. + === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 94ceaedebc..2949dcc9fe 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3859,7 +3859,11 @@ class Parser { wfDebug( __METHOD__.": Not adding tracking category $msg to special page!\n" ); return false; } - $cat = wfMsgForContent( $msg ); + // Important to parse with correct title (bug 31469) + $cat = wfMessage( $msg ) + ->title( $this->getTitle() ) + ->inContentLanguage() + ->text(); # Allow tracking categories to be disabled by setting them to "-" if ( $cat === '-' ) {