r79791 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79790‎ | r79791 | r79792 >
Date:02:42, 7 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Add some more requireOnlyOneParameter related errors

Remove some duplicated errors
Modified paths:
  • /trunk/phase3/includes/api/ApiDelete.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMove.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMove.php
@@ -225,6 +225,8 @@
226226
227227 public function getPossibleErrors() {
228228 return array_merge( parent::getPossibleErrors(), array(
 229+ array( 'code' => 'missingparam', 'info' => 'One of the parameters from, fromid is required' ),
 230+ array( 'code' => 'invalidparammix', 'info' => 'The parameters from, fromid can not be used together' ),
229231 array( 'invalidtitle', 'from' ),
230232 array( 'nosuchpageid', 'fromid' ),
231233 array( 'notanarticle' ),
Index: trunk/phase3/includes/api/ApiDelete.php
@@ -256,6 +256,8 @@
257257
258258 public function getPossibleErrors() {
259259 return array_merge( parent::getPossibleErrors(), array(
 260+ array( 'code' => 'missingparam', 'info' => 'One of the parameters title, pageid is required' ),
 261+ array( 'code' => 'invalidparammix', 'info' => 'The parameters title, pageid can not be used together' ),
260262 array( 'invalidtitle', 'title' ),
261263 array( 'nosuchpageid', 'pageid' ),
262264 array( 'notanarticle' ),
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -474,10 +474,8 @@
475475 array( 'uploaddisabled' ),
476476 array( 'invalid-session-key' ),
477477 array( 'uploaddisabled' ),
478 - array( 'badaccess-groups' ),
479478 array( 'mustbeloggedin', 'upload' ),
480479 array( 'badaccess-groups' ),
481 - array( 'badaccess-groups' ),
482480 array( 'code' => 'fetchfileerror', 'info' => '' ),
483481 array( 'code' => 'nomodule', 'info' => 'No upload module set' ),
484482 array( 'code' => 'empty-file', 'info' => 'The file you submitted was empty' ),
@@ -486,6 +484,8 @@
487485 array( 'code' => 'overwrite', 'info' => 'Overwriting an existing file is not allowed' ),
488486 array( 'code' => 'stashfailed', 'info' => 'Stashing temporary file failed' ),
489487 array( 'code' => 'internal-error', 'info' => 'An internal error occurred' ),
 488+ array( 'code' => 'missingparam', 'info' => 'One of the parameters sessionkey, file, url, statuskey is required' ),
 489+ array( 'code' => 'invalidparammix', 'info' => 'The parameters sessionkey, file, url, statuskey can not be used together' ),
490490 ) );
491491 }
492492

Status & tagging log