r70474 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70473‎ | r70474 | r70475 >
Date:19:20, 4 August 2010
Author:reedy
Status:ok
Tags:
Comment:
Followup r70461 if PARAM_REQUIRED is set, use for missing param in getPossibleErrors in ApiBase

All but ApiQueryBacklinks
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiBlock.php (modified) (history)
  • /trunk/phase3/includes/api/ApiEditPage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiEmailUser.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMove.php (modified) (history)
  • /trunk/phase3/includes/api/ApiPatrol.php (modified) (history)
  • /trunk/phase3/includes/api/ApiProtect.php (modified) (history)
  • /trunk/phase3/includes/api/ApiPurge.php (modified) (history)
  • /trunk/phase3/includes/api/ApiRollback.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUndelete.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMove.php
@@ -223,7 +223,6 @@
224224
225225 public function getPossibleErrors() {
226226 return array_merge( parent::getPossibleErrors(), array(
227 - array( 'missingparam', 'to' ),
228227 array( 'invalidtitle', 'from' ),
229228 array( 'nosuchpageid', 'fromid' ),
230229 array( 'notanarticle' ),
Index: trunk/phase3/includes/api/ApiProtect.php
@@ -196,8 +196,6 @@
197197
198198 public function getPossibleErrors() {
199199 return array_merge( parent::getPossibleErrors(), array(
200 - array( 'missingparam', 'title' ),
201 - array( 'missingparam', 'protections' ),
202200 array( 'invalidtitle', 'title' ),
203201 array( 'toofewexpiries', 'noofexpiries', 'noofprotections' ),
204202 array( 'create-titleexists' ),
Index: trunk/phase3/includes/api/ApiPurge.php
@@ -102,7 +102,6 @@
103103 public function getPossibleErrors() {
104104 return array_merge( parent::getPossibleErrors(), array(
105105 array( 'cantpurge' ),
106 - array( 'missingparam', 'titles' ),
107106 ) );
108107 }
109108
Index: trunk/phase3/includes/api/ApiRollback.php
@@ -120,8 +120,6 @@
121121
122122 public function getPossibleErrors() {
123123 return array_merge( parent::getPossibleErrors(), array(
124 - array( 'missingparam', 'title' ),
125 - array( 'missingparam', 'user' ),
126124 array( 'invalidtitle', 'title' ),
127125 array( 'notanarticle' ),
128126 array( 'invaliduser', 'user' ),
Index: trunk/phase3/includes/api/ApiEditPage.php
@@ -350,7 +350,6 @@
351351 global $wgMaxArticleSize;
352352
353353 return array_merge( parent::getPossibleErrors(), array(
354 - array( 'missingparam', 'title' ),
355354 array( 'missingtext' ),
356355 array( 'invalidtitle', 'title' ),
357356 array( 'createonly-exists' ),
Index: trunk/phase3/includes/api/ApiEmailUser.php
@@ -114,8 +114,6 @@
115115 public function getPossibleErrors() {
116116 return array_merge( parent::getPossibleErrors(), array(
117117 array( 'usermaildisabled' ),
118 - array( 'missingparam', 'target' ),
119 - array( 'missingparam', 'text' ),
120118 ) );
121119 }
122120
Index: trunk/phase3/includes/api/ApiBlock.php
@@ -173,7 +173,6 @@
174174
175175 public function getPossibleErrors() {
176176 return array_merge( parent::getPossibleErrors(), array(
177 - array( 'missingparam', 'user' ),
178177 array( 'cantblock' ),
179178 array( 'canthide' ),
180179 array( 'cantblock-email' ),
Index: trunk/phase3/includes/api/ApiPatrol.php
@@ -85,7 +85,6 @@
8686
8787 public function getPossibleErrors() {
8888 return array_merge( parent::getPossibleErrors(), array(
89 - array( 'missingparam', 'rcid' ),
9089 array( 'nosuchrcid', 'rcid' ),
9190 ) );
9291 }
Index: trunk/phase3/includes/api/ApiUndelete.php
@@ -138,7 +138,6 @@
139139
140140 public function getPossibleErrors() {
141141 return array_merge( parent::getPossibleErrors(), array(
142 - array( 'missingparam', 'title' ),
143142 array( 'permdenied-undelete' ),
144143 array( 'blockedtext' ),
145144 array( 'invalidtitle', 'title' ),
Index: trunk/phase3/includes/api/ApiBase.php
@@ -1126,6 +1126,15 @@
11271127 public function getPossibleErrors() {
11281128 $ret = array();
11291129
 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+
11301139 if ( $this->mustBePosted() ) {
11311140 $ret[] = array( 'mustbeposted', $this->getModuleName() );
11321141 }
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -397,7 +397,6 @@
398398 array( 'invalid-session-key' ),
399399 array( 'uploaddisabled' ),
400400 array( 'badaccess-groups' ),
401 - array( 'missingparam', 'filename' ),
402401 array( 'mustbeloggedin', 'upload' ),
403402 array( 'badaccess-groups' ),
404403 array( 'badaccess-groups' ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r70476Followup r70474 and r70461, drop missingparam from getPossibleErrorsreedy19:32, 4 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70461Followup to r70460: Committed wrong version of ApiBase.php, convert all core ...soxred9314:15, 4 August 2010

Status & tagging log