Summary: Regression? AJAX watch fails when $wgActionPaths used
                    for watch, unwatch
           Product: MediaWiki
           Version: 1.18-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Javascript

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:


        var title = mw.util.getParamValue( 'title', link.href );
        $ '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] $'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:

1) Set some items in $wgActionPaths, say:

  $actions = array('watch', 'unwatch');
  foreach ($actions as $a)  {
         $wgActionPaths[$a] = "$wgScriptPath/action/$a/$1";

2) Set up appropriate rewrite rules or helper scripts to pass
/action/(un)?watch/Foo over to /index.php?action=blah&title=Foo

3) Load up a page view while logged in.

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Wikibugs-l mailing list

Reply via email to