Make Hovercards work with Special:MyLanguage links
Open, LowPublic

Description

Links that use Special:MyLanguage/ prefix don't currently work with Hovercards.
Is it possible to make these work?
(I see that navpopups also does not work with these links, so perhaps unfeasible)

Example URL: The first 2 links within https://www.mediawiki.org/wiki/Extension:Popups (Special:MyLanguage/Beta_Features and Special:MyLanguage/Beta_Features/Hovercards)

(Discussed onwiki at https://www.mediawiki.org/wiki/Topic:Tbb6kuwn6l95dppd )

Quiddity created this task.Sep 13 2016, 5:24 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 13 2016, 5:24 PM
Quiddity updated the task description. (Show Details)Sep 13 2016, 5:25 PM
ovasileva triaged this task as Low priority.Sep 21 2016, 4:46 PM
ovasileva added a subscriber: ovasileva.

might merge with other changes to hovercards on mediawiki

jeblad added a subscriber: jeblad.Jan 24 2017, 12:13 PM
Jdlrobson added a subscriber: Jdlrobson.

Not sure what the generic solution would be for this. Needs some thought from devs.

For comparison, what do you do with links that go to redirect pages?

@Nikerabbit those are handled by the API as all we do is request the page from the API and tell it to follow redirects. If Special:MyLanguage can behave the same then this would just work... but I'm guessing it doesn't?

Anomie added a comment.Mar 6 2017, 7:51 PM

The API follows redirects by using the redirect table in the database. It also tends to treat Special-page links as, well, special and doesn't do very much with them at all.

It would be possible to have ApiPageSet follow RedirectSpecialArticle redirects too, I suppose. Other RedirectSpecialPage subclasses wouldn't make much sense, though, since they're probably trying to add other URL parameters that API redirect-following isn't going to be able to handle.

Change 341374 had a related patch set uploaded (by anomie):
[mediawiki/core] ApiPageSet: Follow RedirectSpecialArticle redirects

https://gerrit.wikimedia.org/r/341374

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Mar 8 2017, 6:05 PM
Jdlrobson added a subscriber: Tgr.Mar 17 2017, 4:59 PM

@Tgr I'm not too familiar with this code.. would you be able to help with review?

Assuming the API part is done, we still need to modify the PagePreviews codebase to enable 'Special:MyLanguage/' links.

Change 341374 merged by jenkins-bot:
[mediawiki/core@master] ApiPageSet: Follow RedirectSpecialArticle redirects

https://gerrit.wikimedia.org/r/341374

Anomie moved this task from Needs Review to Done on the MediaWiki-API board.Apr 8 2017, 11:57 AM
phuedx added a subscriber: phuedx.Apr 10 2017, 2:49 PM

I guess we don't attempt to load a page preview when a link is prefixed "Special:". We'd have to either maintain a whitelist or pages to attempt to load page previews for all "Special:" prefixed links just in case.

phuedx added a subscriber: GWicke.Apr 10 2017, 5:12 PM

I guess we don't attempt to load a page preview when a link is prefixed "Special:". We'd have to either maintain a whitelist or pages to attempt to load page previews for all "Special:" prefixed links just in case.

It's a little more complicated than a whitelist (see processLinks.js) but yes, in principle, this is how we'd handle titles in NS_SPECIAL.

The real question is whether RESTBase can handle titles like Special:MyLanguage/Beta_Features/Hovercards /cc @GWicke.

Tgr added a comment.Apr 10 2017, 5:28 PM

Note that special page names can be localized, so that e.g. on the Persian Wikipedia the link might look like ویژه:زبان‌های_من/Beta_Features/Hovercards.

ovasileva moved this task from Backlog to Next Up on the Page-Previews board.Jun 20 2017, 1:20 PM