Last modified: 2014-09-23 23:18:10 UTC
When comparing two revisions on Special:ComparePages the JavaScript variable wgAction (or mw.config.get('wgAction')) is empty: http://translatewiki.net/wiki/Special:ComparePages?page1=Translating%3ALanguages&rev1=&page2=Main_Page&rev2=&action=&diffonly= The body class action-view is set correctly. When you are on Special:ComparePages without parameters, alert(wgAction) shows "view" as expected. I can reproduce this only on trunk, 1.17 shows "view" in any case.
Created attachment 9601 [details] Patch against trunk
Hmmm, I think the right thing is to skip the action parameter entirely here, I'm not really sure why it's being explicitly added if it's empty or the default 'view'. It seems that it's being thrown into the form as a way of getting at the global query string parameter in case someone manually sets ?action=purge. There shouldn't be a *form* entry at all here in this case, since we don't want to add it to the resulting URL when submitting the form; it should check something from the context object, I think. Maybe just $context->getRequest()->getVal('action')? Or do we have a better way to get the global action?
Things have changed: the default action is now 'nosuchaction' and all special pages seem to have it as $wgAction, including Special:ComparePages with parameters. So this bug itself seems fixed, altough the odd way of checking for a purge remains.