Add some more requireOnlyOneParameter related errors
authorSam Reed <reedy@users.mediawiki.org>
Fri, 7 Jan 2011 02:42:16 +0000 (02:42 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 7 Jan 2011 02:42:16 +0000 (02:42 +0000)
Remove some duplicated errors

includes/api/ApiDelete.php
includes/api/ApiMove.php
includes/api/ApiUpload.php

index 7aa51f2..5d28174 100644 (file)
@@ -256,6 +256,8 @@ class ApiDelete extends ApiBase {
 
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'missingparam', 'info' => 'One of the parameters title, pageid is required' ),
+                       array( 'code' => 'invalidparammix', 'info' => 'The parameters title, pageid can not be used together' ),
                        array( 'invalidtitle', 'title' ),
                        array( 'nosuchpageid', 'pageid' ),
                        array( 'notanarticle' ),
index adc31fd..63fe758 100644 (file)
@@ -225,6 +225,8 @@ class ApiMove extends ApiBase {
 
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'missingparam', 'info' => 'One of the parameters from, fromid is required' ),
+                       array( 'code' => 'invalidparammix', 'info' => 'The parameters from, fromid can not be used together' ),
                        array( 'invalidtitle', 'from' ),
                        array( 'nosuchpageid', 'fromid' ),
                        array( 'notanarticle' ),
index ca6571e..15e2e65 100644 (file)
@@ -474,10 +474,8 @@ class ApiUpload extends ApiBase {
                        array( 'uploaddisabled' ),
                        array( 'invalid-session-key' ),
                        array( 'uploaddisabled' ),
-                       array( 'badaccess-groups' ),
                        array( 'mustbeloggedin', 'upload' ),
                        array( 'badaccess-groups' ),
-                       array( 'badaccess-groups' ),
                        array( 'code' => 'fetchfileerror', 'info' => '' ),
                        array( 'code' => 'nomodule', 'info' => 'No upload module set' ),
                        array( 'code' => 'empty-file', 'info' => 'The file you submitted was empty' ),
@@ -486,6 +484,8 @@ class ApiUpload extends ApiBase {
                        array( 'code' => 'overwrite', 'info' => 'Overwriting an existing file is not allowed' ),
                        array( 'code' => 'stashfailed', 'info' => 'Stashing temporary file failed' ),
                        array( 'code' => 'internal-error', 'info' => 'An internal error occurred' ),
+                       array( 'code' => 'missingparam', 'info' => 'One of the parameters sessionkey, file, url, statuskey is required' ),
+                       array( 'code' => 'invalidparammix', 'info' => 'The parameters sessionkey, file, url, statuskey can not be used together' ),
                ) );
        }