Index: trunk/phase3/includes/api/ApiMove.php |
— | — | @@ -223,7 +223,6 @@ |
224 | 224 | |
225 | 225 | public function getPossibleErrors() { |
226 | 226 | return array_merge( parent::getPossibleErrors(), array( |
227 | | - array( 'missingparam', 'to' ), |
228 | 227 | array( 'invalidtitle', 'from' ), |
229 | 228 | array( 'nosuchpageid', 'fromid' ), |
230 | 229 | array( 'notanarticle' ), |
Index: trunk/phase3/includes/api/ApiProtect.php |
— | — | @@ -196,8 +196,6 @@ |
197 | 197 | |
198 | 198 | public function getPossibleErrors() { |
199 | 199 | return array_merge( parent::getPossibleErrors(), array( |
200 | | - array( 'missingparam', 'title' ), |
201 | | - array( 'missingparam', 'protections' ), |
202 | 200 | array( 'invalidtitle', 'title' ), |
203 | 201 | array( 'toofewexpiries', 'noofexpiries', 'noofprotections' ), |
204 | 202 | array( 'create-titleexists' ), |
Index: trunk/phase3/includes/api/ApiPurge.php |
— | — | @@ -102,7 +102,6 @@ |
103 | 103 | public function getPossibleErrors() { |
104 | 104 | return array_merge( parent::getPossibleErrors(), array( |
105 | 105 | array( 'cantpurge' ), |
106 | | - array( 'missingparam', 'titles' ), |
107 | 106 | ) ); |
108 | 107 | } |
109 | 108 | |
Index: trunk/phase3/includes/api/ApiRollback.php |
— | — | @@ -120,8 +120,6 @@ |
121 | 121 | |
122 | 122 | public function getPossibleErrors() { |
123 | 123 | return array_merge( parent::getPossibleErrors(), array( |
124 | | - array( 'missingparam', 'title' ), |
125 | | - array( 'missingparam', 'user' ), |
126 | 124 | array( 'invalidtitle', 'title' ), |
127 | 125 | array( 'notanarticle' ), |
128 | 126 | array( 'invaliduser', 'user' ), |
Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -350,7 +350,6 @@ |
351 | 351 | global $wgMaxArticleSize; |
352 | 352 | |
353 | 353 | return array_merge( parent::getPossibleErrors(), array( |
354 | | - array( 'missingparam', 'title' ), |
355 | 354 | array( 'missingtext' ), |
356 | 355 | array( 'invalidtitle', 'title' ), |
357 | 356 | array( 'createonly-exists' ), |
Index: trunk/phase3/includes/api/ApiEmailUser.php |
— | — | @@ -114,8 +114,6 @@ |
115 | 115 | public function getPossibleErrors() { |
116 | 116 | return array_merge( parent::getPossibleErrors(), array( |
117 | 117 | array( 'usermaildisabled' ), |
118 | | - array( 'missingparam', 'target' ), |
119 | | - array( 'missingparam', 'text' ), |
120 | 118 | ) ); |
121 | 119 | } |
122 | 120 | |
Index: trunk/phase3/includes/api/ApiBlock.php |
— | — | @@ -173,7 +173,6 @@ |
174 | 174 | |
175 | 175 | public function getPossibleErrors() { |
176 | 176 | return array_merge( parent::getPossibleErrors(), array( |
177 | | - array( 'missingparam', 'user' ), |
178 | 177 | array( 'cantblock' ), |
179 | 178 | array( 'canthide' ), |
180 | 179 | array( 'cantblock-email' ), |
Index: trunk/phase3/includes/api/ApiPatrol.php |
— | — | @@ -85,7 +85,6 @@ |
86 | 86 | |
87 | 87 | public function getPossibleErrors() { |
88 | 88 | return array_merge( parent::getPossibleErrors(), array( |
89 | | - array( 'missingparam', 'rcid' ), |
90 | 89 | array( 'nosuchrcid', 'rcid' ), |
91 | 90 | ) ); |
92 | 91 | } |
Index: trunk/phase3/includes/api/ApiUndelete.php |
— | — | @@ -138,7 +138,6 @@ |
139 | 139 | |
140 | 140 | public function getPossibleErrors() { |
141 | 141 | return array_merge( parent::getPossibleErrors(), array( |
142 | | - array( 'missingparam', 'title' ), |
143 | 142 | array( 'permdenied-undelete' ), |
144 | 143 | array( 'blockedtext' ), |
145 | 144 | array( 'invalidtitle', 'title' ), |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -1126,6 +1126,15 @@ |
1127 | 1127 | public function getPossibleErrors() { |
1128 | 1128 | $ret = array(); |
1129 | 1129 | |
| 1130 | + $params = $this->getFinalParams(); |
| 1131 | + if ( $params ) { |
| 1132 | + foreach ( $params as $paramName => $paramSettings ) { |
| 1133 | + if( isset( $paramSettings[ApiBase::PARAM_REQUIRED] ) ) { |
| 1134 | + $ret[] = array( 'missingparam', $paramName ); |
| 1135 | + } |
| 1136 | + } |
| 1137 | + } |
| 1138 | + |
1130 | 1139 | if ( $this->mustBePosted() ) { |
1131 | 1140 | $ret[] = array( 'mustbeposted', $this->getModuleName() ); |
1132 | 1141 | } |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -397,7 +397,6 @@ |
398 | 398 | array( 'invalid-session-key' ), |
399 | 399 | array( 'uploaddisabled' ), |
400 | 400 | array( 'badaccess-groups' ), |
401 | | - array( 'missingparam', 'filename' ), |
402 | 401 | array( 'mustbeloggedin', 'upload' ), |
403 | 402 | array( 'badaccess-groups' ), |
404 | 403 | array( 'badaccess-groups' ), |