r113737 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113736‎ | r113737 | r113738 >
Date:17:57, 13 March 2012
Author:rmoen
Status:ok (Comments)
Tags:
Comment:
User:PleaseStand patch fixes bug 34972
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2840,6 +2840,10 @@
28412841 $ns = $title->getNamespace();
28422842 $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $title->getNsText();
28432843
 2844+ // Get the relevant title so that AJAX features can use the correct page name
 2845+ // when making API requests from certain special pages (bug 34972).
 2846+ $relevantTitle = $this->getSkin()->getRelevantTitle();
 2847+
28442848 if ( $ns == NS_SPECIAL ) {
28452849 list( $canonicalName, /*...*/ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
28462850 } elseif ( $this->canUseWikiPage() ) {
@@ -2881,6 +2885,7 @@
28822886 'wgPageContentLanguage' => $lang->getCode(),
28832887 'wgSeparatorTransformTable' => $compactSeparatorTransTable,
28842888 'wgDigitTransformTable' => $compactDigitTransTable,
 2889+ 'wgRelevantPageName' => $relevantTitle->getPrefixedDBKey(),
28852890 );
28862891 if ( $wgContLang->hasVariants() ) {
28872892 $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js
@@ -5,6 +5,11 @@
66 ( function ( $, mw, undefined ) {
77
88 /**
 9+ * The name of the page to watch or unwatch.
 10+ */
 11+var title = mw.config.get( 'wgRelevantPageName', mw.config.get( 'wgPageName' ) );
 12+
 13+/**
914 * Update the link text, link href attribute and (if applicable)
1015 * "loading" class.
1116 *
@@ -24,7 +29,7 @@
2530 ( accesskeyTip ? ' ' + accesskeyTip[0] : '' )
2631 )
2732 .attr( 'href', mw.util.wikiScript() + '?' + $.param({
28 - title: mw.config.get( 'wgPageName' ),
 33+ title: title,
2934 action: action
3035 })
3136 );
@@ -98,7 +103,7 @@
99104
100105 api = new mw.Api();
101106 api[action](
102 - mw.config.get( 'wgPageName' ),
 107+ title,
103108 // Success
104109 function( watchResponse ) {
105110 var otherAction = action === 'watch' ? 'unwatch' : 'watch',
@@ -129,10 +134,10 @@
130135 updateWatchLink( $link, action );
131136
132137 // Format error message
133 - var cleanTitle = mw.config.get( 'wgPageName' ).replace( /_/g, ' ' );
 138+ var cleanTitle = title.replace( /_/g, ' ' );
134139 var link = mw.html.element(
135140 'a', {
136 - 'href': mw.util.wikiGetlink( mw.config.get( 'wgPageName' ) ),
 141+ 'href': mw.util.wikiGetlink( title ),
137142 'title': cleanTitle
138143 }, cleanTitle
139144 );

Sign-offs

UserFlagDate
Krinkleinspected20:21, 13 March 2012

Follow-up revisions

RevisionCommit summaryAuthorDate
r113746update RELEASE-NOTES-1.20 follow up r113737rmoen18:41, 13 March 2012
r113758moved release notes for r113737 to 1.19 (a 1.19-regression fix)...krinkle20:22, 13 March 2012
r113935MFT r112918, r113214, r113394, r113415, r113617, r113710, r113727, r113737, r...reedy17:27, 15 March 2012
r114015MFT r112918, r113214, r113268, r113277, r113312, r113415, r113454, r113737, r...reedy15:18, 16 March 2012

Comments

#Comment by IAlex (talk | contribs)   18:17, 13 March 2012

Please add an entry in RELEASE-NOTES.

#Comment by Reedy (talk | contribs)   16:47, 15 March 2012

Also, it's useful if you copy in the bug title aswell to the commit message.

Just copying the title line, e.g. [https://bugzilla.wikimedia.org/show_bug.cgi?id=34972 Bug 34972] - [Regression] An error occurred while changing your watchlist settings for [[Special:WhatLinksHere/Example]]

#Comment by Reedy (talk | contribs)   16:47, 15 March 2012

Bah, that didn't display how I wanted to...

Just copy in the title line from Bugzilla, makes reviewing a bit easier as then you don't need to click through to the bug in all cases :)

Status & tagging log