Page MenuHomePhabricator

Interwiki links doesn't work in entity subscription in repo
Closed, ResolvedPublic

Description

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptOct 7 2016, 10:59 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I ran this on terbium. It's obvious why it's broken:

ladsgroup@terbium:~$ mwscript eval.php --wiki=wikidatawiki
> $mediaWikiServices = \MediaWiki\MediaWikiServices::getInstance();

> $siteLookup = $mediaWikiServices->getSiteLookup();

> $linkRender = $mediaWikiServices->getLinkRenderer();

> $site = $siteLookup->getSite( 'fawiki' );

> var_dump( $site->getInterwikiIds() );
array(1) {
  [0]=>
  string(2) "fa"
}

> $title = Title::makeTitle( NS_SPECIAL, 'EntityUsage/Q10', '', $site->getInterwikiIds()[0] );

> var_dump( $linkRender->makeLink( $title, 'fawiki' ) );
string(96) "<a href="/wiki/Special:EntityUsage/Q10" class="extiw" title="Special:EntityUsage/Q10">fawiki</a>"

There is a bug in normalizeTarget in LinkeRenderer when the title is a special page. Obviously that's an upstream bug but I can bypass that by using main ns title instead of special ns one.

Change 314840 had a related patch set uploaded (by Ladsgroup):
Use main ns instead of special for external links in action=info in repo

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

Change 314841 had a related patch set uploaded (by Ladsgroup):
Do not normalise external links to special pages

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

Change 314841 merged by jenkins-bot:
Do not normalise external links to special pages

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

Ladsgroup moved this task from Incoming to Done on the User-Ladsgroup board.Oct 8 2016, 11:24 PM
Ladsgroup moved this task from doing to done on the WMDE-TLA-Team board.

Change 314840 abandoned by Ladsgroup:
Use main ns instead of special for external links in action=info in repo

Reason:
Since the upstream fix got merged I0ec004b3f7194696eaca9541d336b061602e36df
It's not needed anymore

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

Ladsgroup closed this task as Resolved.Oct 8 2016, 11:31 PM

Change 315142 had a related patch set uploaded (by Ladsgroup):
Do not normalise external links to special pages

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

Change 315142 merged by jenkins-bot:
Do not normalise external links to special pages

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

Mentioned in SAL (#wikimedia-operations) [2016-10-10T18:22:06Z] <dereckson@tin> Started scap: file php-1.28.0-wmf.21/includes/Linker.php Do not normalise external links to special pages (T147685)

Mentioned in SAL (#wikimedia-operations) [2016-10-10T18:22:09Z] <dereckson@tin> scap aborted: file php-1.28.0-wmf.21/includes/Linker.php Do not normalise external links to special pages (T147685) (duration: 00m 03s)

Mentioned in SAL (#wikimedia-operations) [2016-10-10T18:23:22Z] <dereckson@tin> Synchronized php-1.28.0-wmf.21/includes/Linker.php: Do not normalise external links to special pages (T147685) (duration: 01m 07s)