Steps to replicate the issue:
- Create 3 wikis, wiki_a, wiki_b and wiki_c
- Set $wgSharedDB = 'wiki_a'; on all wikis
- Set $wgSharedTables[] = 'actor'; on all wikis
- Set up file sharing between wiki_b and wiki_c
- Try using files from wiki_b on wiki_c
What happens?: The files appear as red links.
This is because FileSelectQueryBuilder queries the actor table on the shared repository database, as returned by ForeignDBRepo::getDBFactory(). But shared repository's database has an empty actor table, because the actor table actually resides in wiki_a's database.
I fixed this for myself by setting table aliases on the database returned from ::getDBFactory(). But this could be implemented in MediaWiki by allowing a configuration option for shared tables directly in $wgForeignFileRepos. Unless there is an existent configuration option that I'm missing?
What should have happened instead?: The files work.
Software version: 1.44.2 (bc12cea)