Error
Request ID: W@I-EQpAIDkAAICw1wsAAADB
PHP Fatal Error: Argument 1 passed to Wikibase\Client\Specials\SpecialEntityUsage::__construct() must implement interface Wikibase\DataModel\Entity\EntityIdParser, undefined variable given
#0 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiQueryQueryPage.php(129): NO_FUNCTION_GIVEN() #1 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiQuery.php(248): ApiQueryQueryPage->getCacheMode(array) #2 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiMain.php(1570): ApiQuery->execute() #3 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiMain.php(531): ApiMain->executeAction() #4 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling() #5 /srv/mediawiki/php-1.33.0-wmf.2/api.php(87): ApiMain->execute() #6 /srv/mediawiki/w/api.php(3): include(string)
Impact
User queries to API with list=querypage&qppage=EntityUsage are aborted with the above fatal error. Seen in production from at least the following three example urls:
- https://en.wikipedia.org/w/api.php?action=query&list=querypage&qppage=EntityUsage&qplimit=10
- https://ko.wikipedia.org/w/api.php?action=query&list=querypage&qppage=EntityUsage&qplimit=10
- https://www.wikidata.org/w/api.php?action=query&list=querypage&qppage=EntityUsage&qplimit=10
The GUI version of the same special page, works fine. For example at https://ko.wikipedia.org/wiki/Special:EntityUsage.
Notes
There is a second error consistently paired with this one, logged right before the fatal:
PHP Warning: __construct() expects exactly 1 parameter, 0 given #0 /srv/mediawiki/php-1.33.0-wmf.2/extensions/Wikibase/client/includes/Specials/SpecialEntityUsage.php(45): MWExceptionHandler::handleError(integer, string, string, integer, array, array) #1 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiQueryQueryPage.php(129): Wikibase\Client\Specials\SpecialEntityUsage->__construct() #2 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiQuery.php(248): ApiQueryQueryPage->getCacheMode(array) #3 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiMain.php(1570): ApiQuery->execute() #4 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiMain.php(531): ApiMain->executeAction() #5 /srv/mediawiki/php-1.33.0-wmf.2/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling() #6 /srv/mediawiki/php-1.33.0-wmf.2/api.php(87): ApiMain->execute() #7 /srv/mediawiki/w/api.php(3): include(string)