Last modified: 2012-02-13 19:06:18 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.
Fixed in r111397 and r111398.
(In reply to comment #1) > Fixed in r111397 and r111398. Yay, better fix without using $wgTitle! :D