Currently, when Wikibase Client initializes the pageterms API, it uses WikibaseRepo code if the Repo is enabled:
public static function newFromGlobalState( ApiQuery $apiQuery, string $moduleName ): self { // FIXME: HACK: make pageterms work directly on entity pages on the repo. // We should instead use an EntityIdLookup that combines the repo and the client // implementation, see T115117. // NOTE: when changing repo and/or client integration, remember to update the // self-documentation of the API module in the "apihelp-query+pageterms-description" // message and the PageTerms::getExamplesMessages() method. if ( ExtensionRegistry::getInstance()->isLoaded( 'WikibaseRepository' ) ) { $repo = WikibaseRepo::getDefaultInstance(); $termBuffer = $repo->getTermBuffer(); $entityIdLookup = $repo->getEntityContentFactory(); } else { $client = WikibaseClient::getDefaultInstance(); $termBuffer = $client->getTermBuffer(); $entityIdLookup = $client->getEntityIdLookup(); }
This is a hack dating back to 2015 (T115117#1719166). We should find some better solution for this, depending on what the expected behavior of that API on repo wikis is.