r38036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38035‎ | r38036 | r38037 >
Date:16:46, 25 July 2008
Author:ialex
Status:old
Tags:
Comment:
(bug 14659) Passing the default limit param to Special:Recentchanges no more falls back to the user option
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -6,7 +6,7 @@
77 */
88 class SpecialRecentChanges extends SpecialPage {
99 public function __construct() {
10 - SpecialPage::SpecialPage( 'Recentchanges' );
 10+ parent::__construct( 'Recentchanges' );
1111 $this->includable( true );
1212 }
1313
@@ -16,13 +16,14 @@
1717 * @return FormOptions
1818 */
1919 public function getDefaultOptions() {
 20+ global $wgUser;
2021 $opts = new FormOptions();
2122
22 - $opts->add( 'days', (int)User::getDefaultOption( 'rcdays' ) );
23 - $opts->add( 'limit', (int)User::getDefaultOption( 'rclimit' ) );
 23+ $opts->add( 'days', (int)$wgUser->getOption( 'rcdays' ) );
 24+ $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
2425 $opts->add( 'from', '' );
2526
26 - $opts->add( 'hideminor', false );
 27+ $opts->add( 'hideminor', (bool)$wgUser->getOption( 'hideminor' ) );
2728 $opts->add( 'hidebots', true );
2829 $opts->add( 'hideanons', false );
2930 $opts->add( 'hideliu', false );
@@ -34,7 +35,6 @@
3536
3637 $opts->add( 'categories', '' );
3738 $opts->add( 'categories_any', false );
38 -
3939 return $opts;
4040 }
4141
@@ -44,12 +44,9 @@
4545 * @return FormOptions
4646 */
4747 public function setup( $parameters ) {
48 - global $wgUser, $wgRequest;
 48+ global $wgRequest;
4949
5050 $opts = $this->getDefaultOptions();
51 - $opts['days'] = (int)$wgUser->getOption( 'rcdays', $opts['days'] );
52 - $opts['limit'] = (int)$wgUser->getOption( 'rclimit', $opts['limit'] );
53 - $opts['hideminor'] = $wgUser->getOption( 'hideminor', $opts['hideminor'] );
5451 $opts->fetchValuesFromRequest( $wgRequest );
5552
5653 // Give precedence to subpage syntax
Index: trunk/phase3/RELEASE-NOTES
@@ -23,8 +23,8 @@
2424 * $wgExemptFromUserRobotsControl is an array of namespaces to be exempt from
2525 the effect of the new __INDEX__/__NOINDEX__ magic words. (Default: null, ex-
2626 empt all content namespaces.)
27 -* $wgTranslateNumerals is now set to false by default. Those who wants to use the
28 - Eastern Arabic numerals should set it to true.
 27+* $wgTranslateNumerals is now set to false by default. Those who wants to use
 28+ the Eastern Arabic numerals should set it to true.
2929
3030 === New features in 1.14 ===
3131
@@ -34,6 +34,8 @@
3535 === Bug fixes in 1.14 ===
3636
3737 * (bug 14907) DatabasePostgres::fieldType now defined.
 38+* (bug 14659) Passing the default limit param to Special:Recentchanges no more
 39+ falls back to the user option
3840
3941 === API changes in 1.14 ===
4042

Follow-up revisions

RevisionCommit summaryAuthorDate
r38039Per r38036: also fix FormOptionsialex18:06, 25 July 2008

Status & tagging log