From: Alexandre Emsenhuber Date: Fri, 25 Jul 2008 16:46:43 +0000 (+0000) Subject: (bug 14659) Passing the default limit param to Special:Recentchanges no more falls... X-Git-Tag: 1.31.0-rc.0~46373 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=90d8f34713ae9b76fc6dbe60812c1d06b24b7a3e;p=lhc%2Fweb%2Fwiklou.git (bug 14659) Passing the default limit param to Special:Recentchanges no more falls back to the user option --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 86ee8ecbb4..6d46e707a5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -23,8 +23,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * $wgExemptFromUserRobotsControl is an array of namespaces to be exempt from the effect of the new __INDEX__/__NOINDEX__ magic words. (Default: null, ex- empt all content namespaces.) -* $wgTranslateNumerals is now set to false by default. Those who wants to use the - Eastern Arabic numerals should set it to true. +* $wgTranslateNumerals is now set to false by default. Those who wants to use + the Eastern Arabic numerals should set it to true. === New features in 1.14 === @@ -34,6 +34,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN === Bug fixes in 1.14 === * (bug 14907) DatabasePostgres::fieldType now defined. +* (bug 14659) Passing the default limit param to Special:Recentchanges no more + falls back to the user option === API changes in 1.14 === diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index cb718bdcbf..a145eb68d1 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -6,7 +6,7 @@ */ class SpecialRecentChanges extends SpecialPage { public function __construct() { - SpecialPage::SpecialPage( 'Recentchanges' ); + parent::__construct( 'Recentchanges' ); $this->includable( true ); } @@ -16,13 +16,14 @@ class SpecialRecentChanges extends SpecialPage { * @return FormOptions */ public function getDefaultOptions() { + global $wgUser; $opts = new FormOptions(); - $opts->add( 'days', (int)User::getDefaultOption( 'rcdays' ) ); - $opts->add( 'limit', (int)User::getDefaultOption( 'rclimit' ) ); + $opts->add( 'days', (int)$wgUser->getOption( 'rcdays' ) ); + $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) ); $opts->add( 'from', '' ); - $opts->add( 'hideminor', false ); + $opts->add( 'hideminor', (bool)$wgUser->getOption( 'hideminor' ) ); $opts->add( 'hidebots', true ); $opts->add( 'hideanons', false ); $opts->add( 'hideliu', false ); @@ -34,7 +35,6 @@ class SpecialRecentChanges extends SpecialPage { $opts->add( 'categories', '' ); $opts->add( 'categories_any', false ); - return $opts; } @@ -44,12 +44,9 @@ class SpecialRecentChanges extends SpecialPage { * @return FormOptions */ public function setup( $parameters ) { - global $wgUser, $wgRequest; + global $wgRequest; $opts = $this->getDefaultOptions(); - $opts['days'] = (int)$wgUser->getOption( 'rcdays', $opts['days'] ); - $opts['limit'] = (int)$wgUser->getOption( 'rclimit', $opts['limit'] ); - $opts['hideminor'] = $wgUser->getOption( 'hideminor', $opts['hideminor'] ); $opts->fetchValuesFromRequest( $wgRequest ); // Give precedence to subpage syntax