Merge "PrefixSearch: avoid looking for titles that don't exist"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 26 Oct 2015 19:13:01 +0000 (19:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 26 Oct 2015 19:13:01 +0000 (19:13 +0000)
12 files changed:
includes/api/ApiQueryAllCategories.php
includes/api/ApiQueryAllDeletedRevisions.php
includes/api/ApiQueryAllImages.php
includes/api/ApiQueryInfo.php
includes/api/ApiQueryRevisionsBase.php
includes/api/ApiQuerySearch.php
includes/api/ApiQueryStashImageInfo.php
includes/api/ApiQueryUserInfo.php
includes/api/ApiQueryUsers.php
includes/api/ApiUpload.php
includes/resourceloader/ResourceLoader.php
package.json

index 0711c90..30978a1 100644 (file)
@@ -169,11 +169,9 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
                                ),
                        ),
                        'min' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_TYPE => 'integer'
                        ),
                        'max' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_TYPE => 'integer'
                        ),
                        'limit' => array(
index 4f7984e..8cb1119 100644 (file)
@@ -392,7 +392,6 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
                        'namespace' => array(
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => 'namespace',
-                               ApiBase::PARAM_DFLT => null,
                        ),
                        'start' => array(
                                ApiBase::PARAM_TYPE => 'timestamp',
index 877423e..699cba8 100644 (file)
@@ -374,7 +374,6 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                                )
                        ),
                        'mime' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_ISMULTI => true,
                        ),
                        'limit' => array(
index b05c75c..7967826 100644 (file)
@@ -827,7 +827,6 @@ class ApiQueryInfo extends ApiQueryBase {
        public function getAllowedParams() {
                return array(
                        'prop' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => array(
                                        'protection',
@@ -851,7 +850,6 @@ class ApiQueryInfo extends ApiQueryBase {
                        ),
                        'token' => array(
                                ApiBase::PARAM_DEPRECATED => true,
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() )
                        ),
index 609efb0..ebc5c2e 100644 (file)
@@ -485,15 +485,12 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                                ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-parse',
                        ),
                        'section' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-section',
                        ),
                        'diffto' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-diffto',
                        ),
                        'difftotext' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-difftotext',
                        ),
                        'difftotextpst' => array(
@@ -502,7 +499,6 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                        ),
                        'contentformat' => array(
                                ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-contentformat',
                        ),
                );
index 32607a5..637fc4c 100644 (file)
@@ -308,7 +308,6 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                ApiBase::PARAM_ISMULTI => true,
                        ),
                        'what' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_TYPE => array(
                                        'title',
                                        'text',
index 3de72bf..0a75961 100644 (file)
@@ -78,12 +78,10 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
                return array(
                        'filekey' => array(
                                ApiBase::PARAM_ISMULTI => true,
-                               ApiBase::PARAM_DFLT => null
                        ),
                        'sessionkey' => array(
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_DEPRECATED => true,
-                               ApiBase::PARAM_DFLT => null
                        ),
                        'prop' => array(
                                ApiBase::PARAM_ISMULTI => true,
index f916537..93c0dd0 100644 (file)
@@ -250,7 +250,6 @@ class ApiQueryUserInfo extends ApiQueryBase {
        public function getAllowedParams() {
                return array(
                        'prop' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => array(
                                        'blockinfo',
index 1d0048c..a826c1b 100644 (file)
@@ -294,7 +294,6 @@ class ApiQueryUsers extends ApiQueryBase {
        public function getAllowedParams() {
                return array(
                        'prop' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => array(
                                        'blockinfo',
index 320649f..5e13e98 100644 (file)
@@ -836,7 +836,6 @@ class ApiUpload extends ApiBase {
                        'url' => null,
                        'filekey' => null,
                        'sessionkey' => array(
-                               ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_DEPRECATED => true,
                        ),
                        'stash' => false,
index c9c60bc..dfd9a8f 100644 (file)
@@ -322,13 +322,15 @@ class ResourceLoader implements LoggerAwareInterface {
                // Allow multiple modules to be registered in one call
                $registrations = is_array( $name ) ? $name : array( $name => $info );
                foreach ( $registrations as $name => $info ) {
-                       // Disallow duplicate registrations
+                       // Warn on duplicate registrations
                        if ( isset( $this->moduleInfos[$name] ) ) {
                                // A module has already been registered by this name
-                               throw new MWException(
-                                       'ResourceLoader duplicate registration error. ' .
-                                       'Another module has already been registered as ' . $name
-                               );
+                               if ( $this->moduleInfos[$name] === $info ) {
+                                       $this->logger->warning(
+                                               'ResourceLoader duplicate registration warning. ' .
+                                               'Another module has already been registered as ' . $name
+                                       );
+                               }
                        }
 
                        // Check $name for validity
index 3ae7b78..209d325 100644 (file)
@@ -13,7 +13,7 @@
     "grunt-contrib-jshint": "0.11.3",
     "grunt-contrib-watch": "0.6.1",
     "grunt-jscs": "2.1.0",
-    "grunt-jsonlint": "1.0.4",
+    "grunt-jsonlint": "1.0.5",
     "grunt-karma": "0.12.1",
     "karma": "0.13.10",
     "karma-chrome-launcher": "0.2.0",