(bug 14659) Passing the default limit param to Special:Recentchanges no more falls...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 25 Jul 2008 16:46:43 +0000 (16:46 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 25 Jul 2008 16:46:43 +0000 (16:46 +0000)
RELEASE-NOTES
includes/specials/SpecialRecentchanges.php

index 86ee8ec..6d46e70 100644 (file)
@@ -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 ===
 
index cb718bd..a145eb6 100644 (file)
@@ -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