* (bug 21105) list=usercontribs can now list contribs for User:0
* (bug 21085) list=deletedrevs no longer returns only one revision when
drcontinue param is passed
+* (bug 21106) Deprecated parameters now tagged in action=paraminfo
=== Languages updated in 1.16 ===
const PARAM_MAX2 = 4; // Max value allowed for a parameter for bots and sysops. Only applies if TYPE='integer'
const PARAM_MIN = 5; // Lowest value allowed for a parameter. Only applies if TYPE='integer'
const PARAM_ALLOW_DUPLICATES = 6; // Boolean, do we allow the same value to be set more than once when ISMULTI=true
+ const PARAM_DEPRECATED = 7; // Boolean, is the parameter deprecated (will show a warning)
const LIMIT_BIG1 = 500; // Fast query, std user limit
const LIMIT_BIG2 = 5000; // Fast query, bot/sysop limit
if (is_array($desc))
$desc = implode($paramPrefix, $desc);
+ $deprecated = isset( $paramSettings[self :: PARAM_DEPRECATED] ) ?
+ $paramSettings[self :: PARAM_DEPRECATED] : false;
+ if( $deprecated )
+ $desc = "DEPRECATED! $desc";
+
$type = isset($paramSettings[self :: PARAM_TYPE])? $paramSettings[self :: PARAM_TYPE] : null;
if (isset ($type)) {
if (isset ($paramSettings[self :: PARAM_ISMULTI]))
$multi = isset ($paramSettings[self :: PARAM_ISMULTI]) ? $paramSettings[self :: PARAM_ISMULTI] : false;
$type = isset ($paramSettings[self :: PARAM_TYPE]) ? $paramSettings[self :: PARAM_TYPE] : null;
$dupes = isset ($paramSettings[self:: PARAM_ALLOW_DUPLICATES]) ? $paramSettings[self :: PARAM_ALLOW_DUPLICATES] : false;
+ $deprecated = isset ($paramSettings[self:: PARAM_DEPRECATED]) ? $paramSettings[self :: PARAM_DEPRECATED] : false;
// When type is not given, and no choices, the type is the same as $default
if (!isset ($type)) {
// Throw out duplicates if requested
if (is_array($value) && !$dupes)
$value = array_unique($value);
+
+ // Set a warning if a deprecated parameter has been passed
+ if( $deprecated ) {
+ $this->setWarning( "The $encParamName parameter has been deprecated." );
+ }
}
return $value;
}
// Deprecated parameters
if ($params['watch'])
- {
$watch = true;
- $this->setWarning('The watch parameter has been deprecated.');
- }
elseif ($params['unwatch'])
- {
$watch = false;
- $this->setWarning('The unwatch parameter has been deprecated.');
- }
if($watch)
$reqArr['wpWatchthis'] = '';
'nocreate' => false,
'captchaword' => null,
'captchaid' => null,
- 'watch' => false,
- 'unwatch' => false,
+ 'watch' => array(
+ ApiBase :: PARAM_DFLT => false,
+ ApiBase :: PARAM_DEPRECATED => true,
+ ),
+ 'unwatch' => array(
+ ApiBase :: PARAM_DFLT => false,
+ ApiBase :: PARAM_DEPRECATED => true,
+ ),
'watchlist' => array(
ApiBase :: PARAM_DFLT => 'preferences',
ApiBase :: PARAM_TYPE => array(
'recreate' => 'Override any errors about the article having been deleted in the meantime',
'createonly' => 'Don\'t edit the page if it exists already',
'nocreate' => 'Throw an error if the page doesn\'t exist',
- 'watch' => 'DEPRECATED! Add the page to your watchlist',
- 'unwatch' => 'DEPRECATED! Remove the page from your watchlist',
+ 'watch' => 'Add the page to your watchlist',
+ 'unwatch' => 'Remove the page from your watchlist',
'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
'captchaid' => 'CAPTCHA ID from previous request',
'captchaword' => 'Answer to the CAPTCHA',
$a = array('name' => $n);
if(isset($paramDesc[$n]))
$a['description'] = implode("\n", (array)$paramDesc[$n]);
+ if(isset($p[ApiBase::PARAM_DEPRECATED]))
+ if($p[ApiBase::PARAM_DEPRECATED])
+ $a['deprecated'] = '';
if(!is_array($p))
{
if(is_bool($p))