While working on the parent task we discovered that the CI wiki has trouble building URLs for sitelinks linking to an article on the wiki itself. The same error can be produced locally by configuring the wiki "site" (via addSite.php) without a pagepath. The same might be the case for the CI wiki.
Stack trace (logs):
2023-03-03 13:13:19 afad85161f96 wikidb: [59ebfe0c3027ce06ae46729c] /rest.php/wikibase/v0/entities/items/Q60 TypeError: Return value of Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter::buildUrl() must be of the type string, null returned #0 /workspace/src/extensions/Wikibase/repo/rest-api/src/Infrastructure/SiteLinksReadModelConverter.php(29): Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter->buildUrl(MediaWikiSite, string) #1 [internal function]: Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter->Wikibase\Repo\RestApi\Infrastructure\{closure}(Wikibase\DataModel\SiteLink) #2 /workspace/src/extensions/Wikibase/repo/rest-api/src/Infrastructure/SiteLinksReadModelConverter.php(31): array_map(Closure, array) #3 /workspace/src/extensions/Wikibase/repo/rest-api/src/DataAccess/WikibaseEntityLookupItemDataRetriever.php(78): Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter->convert(Wikibase\DataModel\SiteLinkList) #4 /workspace/src/extensions/Wikibase/repo/rest-api/src/DataAccess/WikibaseEntityLookupItemDataRetriever.php(56): Wikibase\Repo\RestApi\DataAccess\WikibaseEntityLookupItemDataRetriever->itemDataFromRequestedFields(array, Wikibase\DataModel\Entity\Item) ...
This means that SiteLookup->getSite() returned a Site object, but the following Site->getPageUrl() call returned null.
Acceptance criteria:
- sitelink URLs work in CI
- any hack (not merged yet) to make CI happy in the meantime is removed
- double check with PM whether misconfigured sites is something we need to account for