When attempting to use a generator to get templatedata of all templates, I get the following error:
POST api.php?action=templatedata&format=json&generator=allpages&gapnamespace=10
api.php Error from line 86 of includes/api/ApiQueryGeneratorBase.php: Call to a member function addGeneratorContinueParam() on null
Backtrace:
#0 includes/api/ApiQueryAllPages.php(229): ApiQueryGeneratorBase->setContinueEnumParameter(string, string)
#1 includes/api/ApiQueryAllPages.php(52): ApiQueryAllPages->run(ApiPageSet)
#2 includes/api/ApiPageSet.php(176): ApiQueryAllPages->executeGenerator(ApiPageSet)
#3 includes/api/ApiPageSet.php(140): ApiPageSet->executeInternal(boolean)
#4 extensions/TemplateData/api/ApiTemplateData.php(59): ApiPageSet->execute()
#5 includes/api/ApiMain.php(1579): ApiTemplateData->execute()
#6 includes/api/ApiMain.php(535): ApiMain->executeAction()
#7 includes/api/ApiMain.php(506): ApiMain->executeActionWithErrorHandling()
#8 api.php(94): ApiMain->execute()
#9 {main}The ApiStructureTest::testParameterConsistency test is also failing, and I think for a related reason (e.g.).
ApiPageSet contains the following declaration for the generator API parameter:
public function getAllowedParams( $flags = 0 ) { /*…*/ 'generator' => [ ApiBase::PARAM_TYPE => null, ApiBase::PARAM_HELP_MSG => 'api-pageset-param-generator', ApiBase::PARAM_SUBMODULE_PARAM_PREFIX => 'g', ],
but the documentation for ApiBase::PARAM_SUBMODULE_PARAM_PREFIX says it should be used with ApiBase::PARAM_TYPE => 'submodule'. Is that correct? I've tried changing it but other things break.