Move ( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values...
authorSam Reed <reedy@users.mediawiki.org>
Sun, 14 Feb 2010 15:16:09 +0000 (15:16 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 14 Feb 2010 15:16:09 +0000 (15:16 +0000)
includes/api/ApiBase.php
includes/api/ApiQueryCategories.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryWatchlist.php
includes/api/ApiQueryWatchlistRaw.php

index b01c507..3b6fee1 100644 (file)
@@ -865,6 +865,7 @@ abstract class ApiBase {
                'cantoverwrite-sharedfile' => array( 'code' => 'cantoverwrite-sharedfile', 'info' => 'The target file exists on a shared repository and you do not have permission to override it' ),
                'sharedfile-exists' => array( 'code' => 'fileexists-sharedrepo-perm', 'info' => 'The target file exists on a shared repository. Use the ignorewarnings parameter to override it.' ),
                'mustbeposted' => array( 'code' => 'mustbeposted', 'info' => "The \$1 module requires a POST request" ),
+               'show' => array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 
                // ApiEditPage messages
                'noimageredirect-anon' => array( 'code' => 'noimageredirect-anon', 'info' => "Anonymous users can't create image redirects" ),
index bf71ca6..e7b55be 100644 (file)
@@ -93,7 +93,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                }
 
                if ( isset( $show['hidden'] ) && isset( $show['!hidden'] ) )
-                       $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
+                       $this->dieUsageMsg( 'show' );
                if ( isset( $show['hidden'] ) || isset( $show['!hidden'] ) || isset( $prop['hidden'] ) )
                {
                        $this->addOption( 'STRAIGHT_JOIN' );
@@ -220,7 +220,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
        
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'show' ),
                ) );
        }
 
index 5f12e2e..efdc78d 100644 (file)
@@ -132,7 +132,7 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                                        || ( isset ( $show['redirect'] ) && isset ( $show['!redirect'] ) )
                                        || ( isset ( $show['patrolled'] ) && isset ( $show['!patrolled'] ) ) ) {
 
-                               $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
+                               $this->dieUsageMsg( 'show' );
                        }
                        
                        // Check permissions
@@ -529,7 +529,7 @@ class ApiQueryRecentChanges extends ApiQueryBase {
        
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'show' ),
                        array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
                        array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
                ) );
index eeb3c59..8ecbf6e 100644 (file)
@@ -185,7 +185,7 @@ class ApiQueryContributions extends ApiQueryBase {
                        $show = array_flip( $show );
                        if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
                                        || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) ) )
-                               $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
+                               $this->dieUsageMsg( 'show' );
 
                        $this->addWhereIf( 'rev_minor_edit = 0', isset( $show['!minor'] ) );
                        $this->addWhereIf( 'rev_minor_edit != 0', isset( $show['minor'] ) );
@@ -422,7 +422,7 @@ class ApiQueryContributions extends ApiQueryBase {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'code' => 'param_user', 'info' => 'User parameter may not be empty.' ),
                        array( 'code' => 'param_user', 'info' => 'User name user is not valid' ),
-                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'show' ),
                        array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
                ) );
        }
index 4147605..28b242a 100644 (file)
@@ -151,7 +151,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                                        || ( isset ( $show['anon'] ) && isset ( $show['!anon'] ) )
                                        || ( isset ( $show['patrolled'] ) && isset ( $show['!patrolled'] ) ) ) {
 
-                               $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
+                               $this->dieUsageMsg( 'show' );
                        }
                        
                        // Check permissions.  FIXME: should this check $user instead of $wgUser?
@@ -379,7 +379,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                        array( 'code' => 'bad_wltoken', 'info' => 'Incorrect watchlist token provided -- please set a correct token in Special:Preferences' ),
                        array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
                        array( 'code' => 'patrol', 'info' => 'patrol property is not available' ),
-                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'show' ),
                        array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
                        array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
                ) );
index ff9b357..2a60116 100644 (file)
@@ -59,7 +59,7 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
                $prop = array_flip( (array)$params['prop'] );
                $show = array_flip( (array)$params['show'] );
                if ( isset( $show['changed'] ) && isset( $show['!changed'] ) )
-                       $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
+                       $this->dieUsageMsg( 'show' );
 
                $this->addTables( 'watchlist' );
                $this->addFields( array( 'wl_namespace', 'wl_title' ) );
@@ -174,7 +174,7 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
-                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'show' ),
                ) );
        }