From fcdb5b846c4b309c467ee225c0d2d0bcc527c5f3 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 14 Feb 2010 15:16:09 +0000 Subject: [PATCH] Move ( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ) to messageMap --- includes/api/ApiBase.php | 1 + includes/api/ApiQueryCategories.php | 4 ++-- includes/api/ApiQueryRecentChanges.php | 4 ++-- includes/api/ApiQueryUserContributions.php | 4 ++-- includes/api/ApiQueryWatchlist.php | 4 ++-- includes/api/ApiQueryWatchlistRaw.php | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index b01c507afa..3b6fee1c28 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -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" ), diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index bf71ca62b8..e7b55be8c8 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -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' ), ) ); } diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 5f12e2eaf7..efdc78da38 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -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' ), ) ); diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index eeb3c59525..8ecbf6eaab 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -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' ), ) ); } diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 4147605324..28b242a878 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -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' ), ) ); diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index ff9b357c2a..2a60116820 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -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' ), ) ); } -- 2.20.1