Page MenuHomePhabricator

Special pages won't pass The Wikipedia Adventure query parameters
Closed, ResolvedPublic

Description

Special pages don't pass query parameters when doing a redirect, which breaks The Wikipedia Adventure.

Example: go to https://en.wikipedia.org/wiki/Main_Page?tour=twa5&step=15 . You should see a window pop up with the text "Click EDIT SOURCE so you can leave your reply to GaiaGirl".

However, if you go to http://en.wikipedia.org/wiki/Special:MyTalk/TWA/Earth?tour=twa5&step=15 the window won't appear, apparently because Special:MyTalk redirects you to your talk page without leaving "?tour=twa5&step=15" in the URL. But this used to work, which we can know because this link was used on TWA page https://en.wikipedia.org/wiki/Wikipedia:TWA/5/Reply/3

The same problem also affects Special:MyPage

It would be nice if it would be possible to fix this quickly, since WMRS has a lecture about Wikipedia that is supposed to use TWA in Saturday.

Event Timeline

Nikola_Smolenski raised the priority of this task from to High.
Nikola_Smolenski updated the task description. (Show Details)
Nikola_Smolenski added a subscriber: Nikola_Smolenski.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 17 2015, 7:29 AM

I believe this would probably be fixed if params 'tour' and 'step' would be added inside RedirectSpecialArticle::__construct()

Nikola_Smolenski added a subscriber: Ocaasi.
TTO added a subscriber: TTO.Nov 17 2015, 1:38 PM

GuidedTour extension consumes the RedirectSpecialArticleRedirectParams hook, in order to accomplish the same outcome: see https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FGuidedTour/master/GuidedTourHooks.php#L219

I wonder why it's not working?

TTO added a subscriber: matmarex.Nov 17 2015, 1:44 PM

If I go to http://en.wikipedia.org/wiki/Special:MyTalk/TWA/Earth?tour=twa5&step=15&useskin=modern, I get a page in the Modern skin, but useskin=modern doesn't show up in the URL.

I suspect something in resources/src/mediawiki.action/mediawiki.action.view.redirect.js is causing problems here. Pinging @matmarex

matmarex added a comment.EditedNov 17 2015, 2:17 PM

mediawiki.action.view.redirect looks implicated, but I think there's something else weird there happening.

First of all, Special:MyTalk and others should be doing a HTTP 302 redirect to User:Foo, and they don't; the whole page is loaded under the Special:MyTalk URL. I can't reproduce this locally and I have no idea what could be causing it.

Second, if that happens (and it shouldn't be happening…), the value of 'wgInternalRedirectTargetUrl' mw.config option (used in regular wiki redirects to update the page URL and to redirect to sections) should preserve the allowed query parameters, but it doesn't seem to have any. I have no idea how this happens, either.

This comment was removed by Nikola_Smolenski.

I am working with Matt Flaschen to figure this out but it might take a few days.

The Wikipedia Adventure works for me in IE 9.0 on Windows Vista 32-bit.
It fails in Firefox, Chrome, Opera and Safari.
In IE I started at Mission 1 and reached Mission 4 step 12 before a browser crash which was probably unrelated to Wikipedia (the computer has issues).

The Wikipedia Adventure works for me in IE 9.0 on Windows Vista 32-bit.
It fails in Firefox, Chrome, Opera and Safari.
In IE I started at Mission 1 and reached Mission 4 step 12 before a browser crash which was probably unrelated to Wikipedia (the computer has issues).

This should be filed separately. Please elaborate on exactly how it fails in the other browsers. Information from the JavaScript console would help, if you know how to access that.

TTO added a comment.Nov 18 2015, 10:10 PM

I think he's talking about this issue. I can confirm that the bug does not appear in IE 9, because it doesn't support history.replaceState.

In T118823#1814909, @Mattflaschen wrote:

This should be filed separately. Please elaborate on exactly how it fails in the other browsers. Information from the JavaScript console would help, if you know how to access that.

It's about this issue and not a separate issue. This bug is linked as the bug about the broken Wikipedia Adventure in several places at the English Wikipedia. I just wanted to say there is a browser where The Wikipedia Adventure works.
Example of how it fails in Firefox:
Click Mission 2 at https://en.wikipedia.org/wiki/Wikipedia:The_Wikipedia_Adventure
I quickly reach a box with a button saying "Check your new message*". Each time I click the button, the url briefly changes to https://en.wikipedia.org/wiki/Special:MyTalk/TWA?tour=twa2&step=3 and then
https://en.wikipedia.org/wiki/User_talk:PrimeHunter/TWA with no query string.
My account automatically makes an edit to this page and the same box is shown again.

In IE 9.0 the url stays at https://en.wikipedia.org/wiki/Special:MyTalk/TWA?tour=twa2&step=3
I only see the mentioned box once and continue The Wikipedia Adventure without problems when I click the button.

By the way, if this problem can't be fixed soon, there is a workaround in TWA:

  1. In all the Javascript pages, replace every 'Special:MyPage' to 'User:' + mw.config.get( 'wgUserName' ) as was done here
  1. In all the wiki pages, delete links to Special:MyPage and move them to the box, as was done here: if the page URL matches the correct answer, here checked with mw.util.getUrl().match('/2$') then show two buttons, the back button and the continue button that leads to the user page; else have just the back button as usual.

I think he's talking about this issue. I can confirm that the bug does not appear in IE 9, because it doesn't support history.replaceState.

Sorry, my mistake.

I'm starting to look at this, BTW.

Mattflaschen-WMF closed this task as Resolved.Nov 19 2015, 10:38 PM

The issue was being caused by a patch for a security bug T109724, which was now corrected.

It works now on srwiki too, thanks to everyone involved for the quick resolution! :)