(bug 38190) Add "required" flag to some token params
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 18 Jul 2012 17:24:38 +0000 (19:24 +0200)
committerCatrope <roan.kattouw@gmail.com>
Fri, 20 Jul 2012 22:45:51 +0000 (15:45 -0700)
action=block/action=unblock can not have the token required because when
using the gettoken param, the token param can not set.

Change-Id: I15317f16c06f150d29c1b17de76f41a6cfa84820

14 files changed:
RELEASE-NOTES-1.20
includes/api/ApiDelete.php
includes/api/ApiEditPage.php
includes/api/ApiEmailUser.php
includes/api/ApiFileRevert.php
includes/api/ApiImport.php
includes/api/ApiMove.php
includes/api/ApiPatrol.php
includes/api/ApiProtect.php
includes/api/ApiRollback.php
includes/api/ApiUndelete.php
includes/api/ApiUpload.php
includes/api/ApiUserrights.php
includes/api/ApiWatch.php

index fcbb531..1c15cf0 100644 (file)
@@ -195,6 +195,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 29290) API avoids mangling fields in continuation parameters
 * (bug 36987) API avoids mangling fields in continuation parameters
 * (bug 30836) siteinfo prop=specialpagealiases will no longer return nonexistent special pages
+* (bug 38190) Add "required" flag to some token params for hint in api docs.
 
 === Languages updated in 1.20 ===
 
index b5079a2..5932c72 100644 (file)
@@ -180,7 +180,10 @@ class ApiDelete extends ApiBase {
                        'pageid' => array(
                                ApiBase::PARAM_TYPE => 'integer'
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'reason' => null,
                        'watch' => array(
                                ApiBase::PARAM_DFLT => false,
index ff0e0a8..e75c4ad 100644 (file)
@@ -413,7 +413,10 @@ class ApiEditPage extends ApiBase {
                                ApiBase::PARAM_REQUIRED => false,
                        ),
                        'text' => null,
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'summary' => null,
                        'minor' => false,
                        'notminor' => false,
index 4b6ba00..4fa0343 100644 (file)
@@ -98,7 +98,10 @@ class ApiEmailUser extends ApiBase {
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'ccme' => false,
                );
        }
index 7cac0eb..08a9c8e 100644 (file)
@@ -126,7 +126,10 @@ class ApiFileRevert extends ApiBase {
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true,
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                );
 
        }
index 15eac33..abd2777 100644 (file)
@@ -98,7 +98,10 @@ class ApiImport extends ApiBase {
        public function getAllowedParams() {
                global $wgImportSources;
                return array(
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'summary' => null,
                        'xml' => null,
                        'interwikisource' => array(
index 1fd81ab..55148b1 100644 (file)
@@ -177,7 +177,10 @@ class ApiMove extends ApiBase {
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'reason' => '',
                        'movetalk' => false,
                        'movesubpages' => false,
index 45d19d0..cb5e081 100644 (file)
@@ -65,7 +65,10 @@ class ApiPatrol extends ApiBase {
 
        public function getAllowedParams() {
                return array(
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'rcid' => array(
                                ApiBase::PARAM_TYPE => 'integer',
                                ApiBase::PARAM_REQUIRED => true
index e763fd5..d516504 100644 (file)
@@ -139,7 +139,10 @@ class ApiProtect extends ApiBase {
                        'pageid' => array(
                                ApiBase::PARAM_TYPE => 'integer',
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'protections' => array(
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_REQUIRED => true,
index dddbb85..677df16 100644 (file)
@@ -90,7 +90,10 @@ class ApiRollback extends ApiBase {
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'summary' => '',
                        'markbot' => false,
                        'watchlist' => array(
index ffecc0e..c996251 100644 (file)
@@ -94,7 +94,10 @@ class ApiUndelete extends ApiBase {
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'reason' => '',
                        'timestamps' => array(
                                ApiBase::PARAM_TYPE => 'timestamp',
index aaa4c85..31b4351 100644 (file)
@@ -560,7 +560,10 @@ class ApiUpload extends ApiBase {
                                ApiBase::PARAM_DFLT => ''
                        ),
                        'text' => null,
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'watch' => array(
                                ApiBase::PARAM_DFLT => false,
                                ApiBase::PARAM_DEPRECATED => true,
index c664398..cbb66a4 100644 (file)
@@ -100,7 +100,10 @@ class ApiUserrights extends ApiBase {
                                ApiBase::PARAM_TYPE => User::getAllGroups(),
                                ApiBase::PARAM_ISMULTI => true
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'reason' => array(
                                ApiBase::PARAM_DFLT => ''
                        )
index 3801aec..0509f1f 100644 (file)
@@ -88,7 +88,10 @@ class ApiWatch extends ApiBase {
                                ApiBase::PARAM_REQUIRED => true
                        ),
                        'unwatch' => false,
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                );
        }