r62465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62464‎ | r62465 | r62466 >
Date:15:16, 14 February 2010
Author:reedy
Status:ok
Tags:
Comment:
Move ( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ) to messageMap
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategories.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlistRaw.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -132,7 +132,7 @@
133133 || ( isset ( $show['redirect'] ) && isset ( $show['!redirect'] ) )
134134 || ( isset ( $show['patrolled'] ) && isset ( $show['!patrolled'] ) ) ) {
135135
136 - $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
 136+ $this->dieUsageMsg( 'show' );
137137 }
138138
139139 // Check permissions
@@ -529,7 +529,7 @@
530530
531531 public function getPossibleErrors() {
532532 return array_merge( parent::getPossibleErrors(), array(
533 - array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 533+ array( 'show' ),
534534 array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
535535 array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
536536 ) );
Index: trunk/phase3/includes/api/ApiQueryWatchlistRaw.php
@@ -59,7 +59,7 @@
6060 $prop = array_flip( (array)$params['prop'] );
6161 $show = array_flip( (array)$params['show'] );
6262 if ( isset( $show['changed'] ) && isset( $show['!changed'] ) )
63 - $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
 63+ $this->dieUsageMsg( 'show' );
6464
6565 $this->addTables( 'watchlist' );
6666 $this->addFields( array( 'wl_namespace', 'wl_title' ) );
@@ -174,7 +174,7 @@
175175 public function getPossibleErrors() {
176176 return array_merge( parent::getPossibleErrors(), array(
177177 array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
178 - array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 178+ array( 'show' ),
179179 ) );
180180 }
181181
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -151,7 +151,7 @@
152152 || ( isset ( $show['anon'] ) && isset ( $show['!anon'] ) )
153153 || ( isset ( $show['patrolled'] ) && isset ( $show['!patrolled'] ) ) ) {
154154
155 - $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
 155+ $this->dieUsageMsg( 'show' );
156156 }
157157
158158 // Check permissions. FIXME: should this check $user instead of $wgUser?
@@ -379,7 +379,7 @@
380380 array( 'code' => 'bad_wltoken', 'info' => 'Incorrect watchlist token provided -- please set a correct token in Special:Preferences' ),
381381 array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
382382 array( 'code' => 'patrol', 'info' => 'patrol property is not available' ),
383 - array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 383+ array( 'show' ),
384384 array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
385385 array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
386386 ) );
Index: trunk/phase3/includes/api/ApiBase.php
@@ -865,6 +865,7 @@
866866 'cantoverwrite-sharedfile' => array( 'code' => 'cantoverwrite-sharedfile', 'info' => 'The target file exists on a shared repository and you do not have permission to override it' ),
867867 'sharedfile-exists' => array( 'code' => 'fileexists-sharedrepo-perm', 'info' => 'The target file exists on a shared repository. Use the ignorewarnings parameter to override it.' ),
868868 'mustbeposted' => array( 'code' => 'mustbeposted', 'info' => "The \$1 module requires a POST request" ),
 869+ 'show' => array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
869870
870871 // ApiEditPage messages
871872 'noimageredirect-anon' => array( 'code' => 'noimageredirect-anon', 'info' => "Anonymous users can't create image redirects" ),
Index: trunk/phase3/includes/api/ApiQueryCategories.php
@@ -93,7 +93,7 @@
9494 }
9595
9696 if ( isset( $show['hidden'] ) && isset( $show['!hidden'] ) )
97 - $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
 97+ $this->dieUsageMsg( 'show' );
9898 if ( isset( $show['hidden'] ) || isset( $show['!hidden'] ) || isset( $prop['hidden'] ) )
9999 {
100100 $this->addOption( 'STRAIGHT_JOIN' );
@@ -220,7 +220,7 @@
221221
222222 public function getPossibleErrors() {
223223 return array_merge( parent::getPossibleErrors(), array(
224 - array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 224+ array( 'show' ),
225225 ) );
226226 }
227227
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -185,7 +185,7 @@
186186 $show = array_flip( $show );
187187 if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
188188 || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) ) )
189 - $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
 189+ $this->dieUsageMsg( 'show' );
190190
191191 $this->addWhereIf( 'rev_minor_edit = 0', isset( $show['!minor'] ) );
192192 $this->addWhereIf( 'rev_minor_edit != 0', isset( $show['minor'] ) );
@@ -422,7 +422,7 @@
423423 return array_merge( parent::getPossibleErrors(), array(
424424 array( 'code' => 'param_user', 'info' => 'User parameter may not be empty.' ),
425425 array( 'code' => 'param_user', 'info' => 'User name user is not valid' ),
426 - array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
 426+ array( 'show' ),
427427 array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
428428 ) );
429429 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r62466Followup to r62465, should be in an arrayreedy15:19, 14 February 2010

Status & tagging log