From 2fc7279345055bc77bfe47639862dc3a49a5bfbe Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 28 Nov 2011 20:35:32 +0000 Subject: [PATCH] * (bug 32688) Paraminfo for parameter "generator" of the query module shows too many types Pass prop and list through the generator filtering in the constructor --- RELEASE-NOTES-1.19 | 4 +++- includes/api/ApiQuery.php | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 7620f2bcc0..c7d2338967 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -183,8 +183,10 @@ production. * (bug 7304) Links on redirect pages no longer cause the redirect page to show up as a redirect to the linked page on Special:Whatlinkshere. * (bug 32609) API: Move captchaid/captchaword of action=edit from core - to Captcha extension(s) + to Captcha extension(s). * Added 'ApiGetDescription' hook. +* (bug 32688) Paraminfo for parameter "generator" of the query module shows too + many types === Languages updated in 1.19 === diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 83f154218a..b3be027f52 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -101,6 +101,8 @@ class ApiQuery extends ApiBase { private $mSlaveDB = null; private $mNamedDB = array(); + protected $mAllowedGenerators = array(); + public function __construct( $main, $action ) { parent::__construct( $main, $action ); @@ -114,9 +116,8 @@ class ApiQuery extends ApiBase { $this->mListModuleNames = array_keys( $this->mQueryListModules ); $this->mMetaModuleNames = array_keys( $this->mQueryMetaModules ); - // Allow the entire list of modules at first, - // but during module instantiation check if it can be used as a generator. - $this->mAllowedGenerators = array_merge( $this->mListModuleNames, $this->mPropModuleNames ); + $this->makeHelpMsgHelper( $this->mQueryPropModules, 'prop' ); + $this->makeHelpMsgHelper( $this->mQueryListModules, 'list' ); } /** @@ -631,6 +632,9 @@ class ApiQuery extends ApiBase { $moduleDescriptions = array(); foreach ( $moduleList as $moduleName => $moduleClass ) { + /** + * @var $module ApiQueryBase + */ $module = new $moduleClass( $this, $moduleName, null ); $msg = ApiMain::makeHelpMsgHeader( $module, $paramName ); -- 2.20.1