Page MenuHomePhabricator

Interlanguage links not appearing on Flow pages
Closed, DuplicatePublic

Description

The interlanguage links (links on the left sidebar to pages on the same topic in other languages) are not appearing on pages where the content model is Flow, even when the corresponding Wikidata item has linked pages on other wikis.

Examples:
https://gom.wikipedia.org/wiki/विकिपीडिया:Tinto
https://ca.wikipedia.org/wiki/Viquipèdia:La_taverna/Tecnicismes
https://pl.wikipedia.org/wiki/Pomoc:Pytania_nowicjuszy
https://zh.wikipedia.org/wiki/Wikipedia:%E7%9F%A5%E8%AF%86%E9%97%AE%E7%AD%94
https://www.mediawiki.org/wiki/Project:Support_desk

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 12 2017, 9:55 AM
Catrope added a subscriber: Catrope.

I'm guessing this is probably a bug in how Wikidata injects these language links? If it turns out to be a bug in Flow, or if Flow turns out to do something unhelpful, please do let us know.

Lydia_Pintscher triaged this task as Medium priority.Jun 11 2017, 5:47 PM
Restricted Application added a subscriber: Cosine02. · View Herald TranscriptAug 30 2017, 1:45 PM
hoo added a comment.Sep 20 2017, 6:32 PM

I looked into this a bit:

The langlinks table is empty:

mysql:wikiadmin@db1078 [gomwiki]> SELECT * FROM langlinks WHERE ll_from = 7451;
Empty set (0.00 sec)

The language links of the ParserOutput are also empty:

hoo@terbium:~$ mwscript eval.php --wiki gomwiki 
> $wikiPage = new WikiPage( Title::newFromID(7451) );

> $popts = ContentHandler::getForTitle( Title::newFromID(7451) )->makeParserOptions( 'canonical' );    

> var_dump( $wikiPage->getParserOutput( $popts ) );
…
  ["mLanguageLinks"]=>
  array(0) {
  }
…

Wikibase is enabled for the NS in question:

hoo@terbium:~$ mwscript eval.php --wiki gomwiki
> var_dump( Wikibase\Client\WikibaseClient::getDefaultInstance()->getNamespaceChecker()->isWikibaseEnabled( Title::newFromID(7451)->getNamespace() ) );
bool(true)

useRepoLinks is true:

hoo@terbium:~$ mwscript eval.php --wiki gomwiki
> $popts = ContentHandler::getForTitle( Title::newFromID(7451) )->makeParserOptions( 'canonical' );

> $wikiPage = new WikiPage( Title::newFromID(7451) );

> $out = $wikiPage->getParserOutput( $popts );

> var_dump( Wikibase\Client\WikibaseClient::getDefaultInstance()->getLangLinkHandler()->useRepoLinks( Title::newFromID(7451), $out ) );
bool(true)
hoo added a comment.Sep 20 2017, 6:38 PM

The problem is that Wikibase uses the ContentAlterParserOutput hook to inject the language links, but Flow doesn't call that. Will fix.

Change 379294 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Flow@master] Make BoardContent::getParserOutput call the "ContentAlterParserOutput" hook

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

Change 379294 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Make BoardContent::getParserOutput call the "ContentAlterParserOutput" hook

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

hoo added a comment.Jan 21 2018, 10:18 AM

Update, after my Flow patch got merged:

The langlinks table is still empty:

mysql:wikiadmin@db1078 [gomwiki]> SELECT * FROM langlinks WHERE ll_from = 7451;
Empty set (0.00 sec)

But the language links in the ParserOutput aren't:

hoo@terbium:~$ mwscript eval.php --wiki gomwiki 
> $wikiPage = new WikiPage( Title::newFromID(7451) );

> $popts = ContentHandler::getForTitle( Title::newFromID(7451) )->makeParserOptions( 'canonical' );    

> var_dump( $wikiPage->getParserOutput( $popts ) );
…
  ["mLanguageLinks"]=>
  array(224) {
    [0]=>
    string(36) "ab:Авикипедиа:Афорум"
    [1]=>
    string(22) "ace:Wikipedia:Meusapat"
    [2]=>
…
  }
…

After that I purged with forcelinksupdate and even removed the link on Wikidata and re-added it, but this still didn't help, the langlinks still don't make it into the DB.

Restricted Application added a project: Growth-Team. · View Herald TranscriptSep 2 2018, 11:25 PM
Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptJul 4 2019, 12:11 PM
Shizhao moved this task from Backlog to Closed on the Chinese-Sites board.Jul 15 2019, 6:19 AM