Steps to replicate the issue (include links if applicable):
- Set up $wgVirtualDomainsMapping['virtual-interwiki'] on wiki A to point to a database on wiki B
- Add an interwiki link on wiki B
- Visit api.php?action=query&meta=siteinfo&siprop=interwikimap on wiki A
What happens?: The newly added interwiki link does not appear.
What should have happened instead?: The newly added link should appear.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia): 1.44.0 (2e299ce)
Other information: This, in turn, causes issues with Parsoid not rendering interwiki links from the virtual domain, since Parsoid uses the siteinfo API to grab the full interwiki map.
My proposal from further below (T404928#11841658):
InterwikiLookup::getAllPrefixes() could get a new parameter, $from, with available flags:
- InterwikiLookup::FROM_LOCAL: fetch interwiki from the local database
- InterwikiLookup::FROM_GLOBAL_INTERWIKI: fetch interwiki from the virtual-interwiki virtual domain
- InterwikiLookup::FROM_GLOBAL_INTERLANGUAGE: fetch interwiki from the virtual-interwiki-interlanguage virtual domain
If multiple flags are passed, the end result concatenates the results from all of them. SpecialInterwiki can then call this method three times with these individual flags (because it needs to display the interwiki in separate tables), whereas ApiQuerySiteinfo can call this method with InterwikiLookup::FROM_LOCAL | InterwikiLookup::FROM_GLOBAL_INTERWIKI | InterwikiLookup::FROM_GLOBAL_INTERLANGUAGE (because it needs all interwiki, regardless of where it comes from).