Tested as of r81491; relevant bit of code was last touched in r78150.
When initializing the AJAX behavior for the watch tab, it seems that current code tries to divine the target page title from the link URL on the watch tab, then save that title as extra data associated with the link node:
in mediawiki.action.watch.ajax.js:
var title = mw.util.getParamValue( 'title', link.href ); $link.data( 'target', title.replace( /_/g, ' ' ) );
This unfortunately fails when the target link doesn't use a query string parameter -- mw.util.getParamValue() is unable to find it, and the next line throws an error:
title is null [Break On This Error] $link.data('target',title.replace(/_/g,' '));
As a result, AJAX watch fails to initialize properly, and the unhandled exception may also halt initialization of other UI elements.
This code probably doesn't need to be trying to pull a title from the link manually; it should probably just be using the available wgTitle.
Steps to reproduce:
- Set some items in $wgActionPaths, say:
$actions = array('watch', 'unwatch'); foreach ($actions as $a) { $wgActionPaths[$a] = "$wgScriptPath/action/$a/$1"; }
- Set up appropriate rewrite rules or helper scripts to pass /action/(un)?watch/Foo over to /index.php?action=blah&title=Foo
- Load up a page view while logged in.
Version: 1.18.x
Severity: normal