From 4b34c32ed2c209d082ea2dcb81703d5d0c9d0384 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 15 Mar 2013 16:35:51 +0100 Subject: [PATCH] API: Remove useless PARAM_REQUIRED = false Also fix the condition in getPossibleErrors to avoid reporting of: Change-Id: Ifd808a040590ddffc0527da5ef0cc8cacdd008d9 --- includes/api/ApiBase.php | 2 +- includes/api/ApiEditPage.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index ee6f2c0a4d..9351a8d8e2 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1568,7 +1568,7 @@ abstract class ApiBase extends ContextSource { $params = $this->getFinalParams(); if ( $params ) { foreach ( $params as $paramName => $paramSettings ) { - if ( isset( $paramSettings[ApiBase::PARAM_REQUIRED] ) ) { + if ( isset( $paramSettings[ApiBase::PARAM_REQUIRED] ) && $paramSettings[ApiBase::PARAM_REQUIRED] ) { $ret[] = array( 'missingparam', $paramName ); } } diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index cba3489a91..4916145bc1 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -496,7 +496,6 @@ class ApiEditPage extends ApiBase { 'section' => null, 'sectiontitle' => array( ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => false, ), 'text' => null, 'token' => array( -- 2.20.1