Lucas_Werkmeister_WMDE created this task.
Lucas_Werkmeister_WMDE added projects: Wikidata, Wikibase Extension Decoupling 
and Registration.

TASK DESCRIPTION
  Currently, when Wikibase Client initializes the pageterms API, it uses 
`WikibaseRepo` code if the Repo is enabled:
  
        $wgAPIPropModules['pageterms'] = [
                'class' => PageTerms::class,
                'factory' => function ( ApiQuery $apiQuery, $moduleName ) {
                        // 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 ( defined( 'WB_VERSION' ) ) {
                                $repo = WikibaseRepo::getDefaultInstance();
                                $termBuffer = $repo->getTermBuffer();
                                $entityIdLookup = 
$repo->getEntityContentFactory();
                        } else {
                                $client = WikibaseClient::getDefaultInstance();
                                $termBuffer = $client->getTermBuffer();
                                $entityIdLookup = $client->getEntityIdLookup();
                        }
    
                        return new PageTerms(
                                $termBuffer,
                                $entityIdLookup,
                                $apiQuery,
                                $moduleName
                        );
                }
        ];
  
  This is a hack dating back to 2015 (T115117#1719166 
<https://phabricator.wikimedia.org/T115117#1719166>). We should find //some// 
better solution for this, depending on what the expected behavior of that API 
on repo wikis is.

TASK DETAIL
  https://phabricator.wikimedia.org/T255882

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Aklapper, Lucas_Werkmeister_WMDE, darthmon_wmde, Nandana, Lahi, Gq86, 
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, 
Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to