Last modified: 2011-12-23 19:00:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T13612, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11612 - Maximum to "Days to show in watchlist" in preferences should equal $wgRCMaxAge
Maximum to "Days to show in watchlist" in preferences should equal $wgRCMaxAge
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User preferences (Other open bugs)
1.18.x
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch-reviewed
: 32315 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-09 10:52 UTC by Katharina Wolkwitz
Modified: 2011-12-23 19:00 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Katharina Wolkwitz 2007-10-09 10:52:35 UTC
It's not possible to enter and save a number larger than 7 for User preferences / recent changes / Days to show in recent changes. If one tries the entry reverts to 7 after pressing the save button.

I believe it's because of this line:

$wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays, 1, 7 ) );

in http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/SpecialPreferences.php?view=markup

The value should be increased (at least up to 30 in order to reflect the possibilities in Special:Recentchanges), and/or the message [[MediaWiki:Recentchangesdays]] could be changed to reflect the restricted range of choices. 

If only certain numbers are to be allowed (as in Special:Recentchanges), it should be changed to a drop-down box rather than a write-in field.
Comment 1 Roan Kattouw 2007-10-09 13:31:46 UTC
This has a reason: the recentchanges table doesn't log every single edit since the beginning of time, but only those in the last 7 days. Older edits are removed from the table on a regular basis. But of course, an rc lifetime larger than 7 days should be allowed for low-traffic wikis.
Comment 2 brianna.laugher 2007-10-09 13:36:39 UTC
(In reply to comment #1)
> This has a reason: the recentchanges table doesn't log every single edit since
> the beginning of time, but only those in the last 7 days. Older edits are
> removed from the table on a regular basis. But of course, an rc lifetime larger
> than 7 days should be allowed for low-traffic wikis.
> 

But on Special:Recentchanges you can choose up to 30 days. Even on en.wp. Is that a mistake?
Comment 3 Roan Kattouw 2007-10-09 13:55:42 UTC
(In reply to comment #2)
> But on Special:Recentchanges you can choose up to 30 days. Even on en.wp. Is
> that a mistake?
> 

My mistake. At Wikipedia and friends $wgRCMaxAge is set to 30 days, and the default value is 7 days. This means the line of code you quoted should probably be

$wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays, 1, ceil($wgRCMaxAge / (3600*24))));
Comment 4 Aaron Schulz 2007-10-09 17:53:58 UTC
$wgRCMaxAge should be 7 for WMF sites. I though domas changed that.
Comment 5 Roan Kattouw 2007-10-09 18:33:15 UTC
(In reply to comment #4)
> $wgRCMaxAge should be 7 for WMF sites. I though domas changed that.
> 

Whatever it is, the point is that $wgRCMaxAge is customizable and therefore the 7 in SpecialPreferences.php shouldn't be hardcoded.
Comment 6 Katharina Wolkwitz 2007-10-10 15:24:11 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > But on Special:Recentchanges you can choose up to 30 days. Even on en.wp. Is
> > that a mistake?
> > 
> 
> My mistake. At Wikipedia and friends $wgRCMaxAge is set to 30 days, and the
> default value is 7 days. This means the line of code you quoted should probably
> be
> 
> $wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays, 1,
> ceil($wgRCMaxAge / (3600*24))));
> 
I've tried this and found that with it, the number of days is alway set to 1 - even though I've set 
$wgRCMaxAge = 100 * 24 * 3600;
in my LocalSettings.php

Using the line
$wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1, 100 ) );
instead allows me to set the number of days to 30.

Is there an error somewhere in your code?

Comment 7 Roan Kattouw 2007-10-10 15:29:10 UTC
(In reply to comment #6)
> I've tried this and found that with it, the number of days is alway set to 1 -
> even though I've set 
> $wgRCMaxAge = 100 * 24 * 3600;
> in my LocalSettings.php
> 
> Using the line
> $wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1, 100 )
> );
> instead allows me to set the number of days to 30.
> 
> Is there an error somewhere in your code?
> 

Yes, this is a bug. The 7 in the "$this->mRecentDays, 1, 7" part should be calculated based on $wgRCMaxAge.
Comment 8 Katharina Wolkwitz 2007-10-11 06:25:52 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > I've tried this and found that with it, the number of days is alway set to 1 -
> > even though I've set 
> > $wgRCMaxAge = 100 * 24 * 3600;
> > in my LocalSettings.php
> > 
> > Using the line
> > $wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1, 100 )
> > );
> > instead allows me to set the number of days to 30.
> > 
> > Is there an error somewhere in your code?
> > 
> 
> Yes, this is a bug. The 7 in the "$this->mRecentDays, 1, 7" part should be
> calculated based on $wgRCMaxAge.
 
I understand and support that idea, but somehow using a parameter like $wgRCMaxAge in the line, like your example

$wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays, 1, ceil($wgRCMaxAge / (3600*24))));

doesn't work. I think the problem lies with the use of a parameter, because I tried setting a new parameter 
$wgMyRCdays = 100; in LocalSettings.php and then using the following line:

$wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1, $wgMyRCdays ) );

But that got the same result: the number of days is always reset to 1. :(

Comment 9 Roan Kattouw 2007-10-11 12:02:11 UTC
> I understand and support that idea, but somehow using a parameter like
> $wgRCMaxAge in the line, like your example
> 
> $wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays, 1,
> ceil($wgRCMaxAge / (3600*24))));
> 
> doesn't work. I think the problem lies with the use of a parameter, because I
> tried setting a new parameter 
> $wgMyRCdays = 100; in LocalSettings.php and then using the following line:
> 
> $wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1,
> $wgMyRCdays ) );
> 
> But that got the same result: the number of days is always reset to 1. :(
> 

I forgot you have to insert the following line right before the modified line:

global $wgRCMaxAge;

For your $wgMyRCDays thingy to work, you would need:

global $wgMyRCDays;
Comment 10 Katharina Wolkwitz 2007-10-11 12:19:59 UTC
(In reply to comment #9)
> > I understand and support that idea, but somehow using a parameter like
> > $wgRCMaxAge in the line, like your example
> > 
> > $wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays, 1,
> > ceil($wgRCMaxAge / (3600*24))));
> > 
> > doesn't work. I think the problem lies with the use of a parameter, because I
> > tried setting a new parameter 
> > $wgMyRCdays = 100; in LocalSettings.php and then using the following line:
> > 
> > $wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1,
> > $wgMyRCdays ) );
> > 
> > But that got the same result: the number of days is always reset to 1. :(
> > 
> 
> I forgot you have to insert the following line right before the modified line:
> 
> global $wgRCMaxAge;
> 
> For your $wgMyRCDays thingy to work, you would need:
> 
> global $wgMyRCDays;

Thanks - now it works based on the $wgRCMaxAge-value set in LocalSettings.php :-)

Comment 11 Roan Kattouw 2007-10-11 12:33:21 UTC
(In reply to comment #10)
> Thanks - now it works based on the $wgRCMaxAge-value set in LocalSettings.php
> :-)

Good. I've fixed this on trunk in r26591, which means future versions of MediaWiki will no longer have this bug.

Comment 12 charitwo 2011-05-25 05:08:28 UTC
On sites with multiple wikis, especially ones with low traffic, it should be possible to set your preferences to show days in recent changes greater than 30s if $wgRCMaxAge allows it.
Comment 13 Nemo 2011-10-22 11:03:54 UTC
Clarified summary. The problem is still there: in any WMF wiki I've checked, "Days to show in watchlist" in the preferences is said to be "Maximum 7 days" (and it actually works, n > 7 can't be saved).

Because of bug 26022 you can't know from the interface what the actual maximum is (unless you have enough pages in watchlist and you ask "all days") and it can change, so I've always just put 0 in the wikis where I want to see everything, but it's not very user-friendly for the newbies who don't know the trick.

General rationale: there's no reason why the preferences for a special page should be allowed to remember only the values suggested by the GUI of the special page itself; "adding" values 7 < n ≤ $wgRCMaxAge in the preferences doesn't clutter the interface. Compare bug 31881 which could reduce flexibility or require too much clutter in the special pages (where it harms more than in the preferences).
Comment 14 Alexandre Emsenhuber [IAlex] 2011-11-09 15:15:08 UTC
*** Bug 32315 has been marked as a duplicate of this bug. ***
Comment 15 bsitu 2011-12-23 19:00:36 UTC
Fixed in r107169

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links