From 8381c3338b8bc1e306d0640c263c4bd958e61d1a Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 7 Jan 2011 02:42:16 +0000 Subject: [PATCH] Add some more requireOnlyOneParameter related errors Remove some duplicated errors --- includes/api/ApiDelete.php | 2 ++ includes/api/ApiMove.php | 2 ++ includes/api/ApiUpload.php | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 7aa51f28cd..5d28174d4c 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -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' ), diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index adc31fd29a..63fe7583aa 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -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' ), diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index ca6571e147..15e2e65fc3 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -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' ), ) ); } -- 2.20.1