Last modified: 2012-02-13 19:06:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36377, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34377 - action=watch parses message using "API" instead of the page being watched or unwatched
action=watch parses message using "API" instead of the page being watched or ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-13 18:27 UTC by Brad Jorsch
Modified: 2012-02-13 19:06 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to set $wgTitle so action=watch parses messages correctly. (524 bytes, patch)
2012-02-13 18:27 UTC, Brad Jorsch
Details

Description Brad Jorsch 2012-02-13 18:27:02 UTC
Created attachment 10002 [details]
Patch to set $wgTitle so action=watch parses messages correctly.

The API's action=watch parses MediaWiki:Addedwatchtext or MediaWiki:Removedwatchtext (as appropriate) and returns it as "message" in the response. However, when these messages are parsed they are parsed with the current page set to "API" rather than the page being watched or unwatched, which means that magic words such as {{NAMESPACE}} or {{TALKSPACE}} will return the wrong value. [[en:MediaWiki:Addedwatchtext]], for example, uses these magic words to provide a better response to the user when watch is used on a talk page.

The problem seems easy enough to fix: since wfMsgExt doesn't pass a title, MessageCache uses $wgTitle. So if we just set $wgTitle appropriately from the API's watch module, everything works as it should.

As a workaround, affected wikis can use {{NAMESPACE:$1}} and the like in their messages.
Comment 1 Alexandre Emsenhuber [IAlex] 2012-02-13 18:55:43 UTC
Fixed in r111397 and r111398.
Comment 2 Sam Reed (reedy) 2012-02-13 19:06:18 UTC
(In reply to comment #1)
> Fixed in r111397 and r111398.

Yay, better fix without using $wgTitle! :D

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links