r49646 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49645‎ | r49646 | r49647 >
Date:18:43, 19 April 2009
Author:purodha
Status:reverted (Comments)
Tags:
Comment:
(bug 7039) Show/hide bots/own edits from Recentchanges via preferences
(Bug 16957) partial fix: Show/hide bots/own edits from Newpage via preferences
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -53,6 +53,10 @@
5454 'highlightbroken',
5555 'justify',
5656 'hideminor',
 57+ 'rc_hidebots',
 58+ 'rc_hideown',
 59+ 'newpageshidebots',
 60+ 'newpageshideown',
5761 'extendwatchlist',
5862 'usenewrc',
5963 'numberheadings',
Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -25,7 +25,8 @@
2626 $this->opts = $opts; // bind
2727 $opts->add( 'hideliu', false );
2828 $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'newpageshidepatrolled' ) );
29 - $opts->add( 'hidebots', false );
 29+ $opts->add( 'hidebots', $wgUser->getBoolOption( 'newpageshidebots' ) );
 30+ $opts->add( 'hideown', $wgUser->getBoolOption( 'newpageshideown' ) );
3031 $opts->add( 'hideredirs', true );
3132 $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
3233 $opts->add( 'offset', '' );
@@ -60,6 +61,8 @@
6162 $this->opts->setValue( 'hidepatrolled', true );
6263 if ( 'hidebots' == $bit )
6364 $this->opts->setValue( 'hidebots', true );
 65+ if ( 'hideown' == $bit )
 66+ $this->opts->setValue( 'hideown', true );
6467 if ( 'showredirs' == $bit )
6568 $this->opts->setValue( 'hideredirs', false );
6669 if ( is_numeric( $bit ) )
@@ -132,6 +135,7 @@
133136 'hideliu' => 'rcshowhideliu',
134137 'hidepatrolled' => 'rcshowhidepatr',
135138 'hidebots' => 'rcshowhidebots',
 139+ 'hideown' => 'rcshowhidemine',
136140 'hideredirs' => 'whatlinkshere-hideredirs'
137141 );
138142
@@ -387,6 +391,7 @@
388392
389393 function getQueryInfo() {
390394 global $wgEnableNewpagesUserFilter, $wgGroupPermissions, $wgUser;
 395+ $dbr = wfGetDB( DB_SLAVE );
391396 $conds = array();
392397 $conds['rc_new'] = 1;
393398
@@ -418,7 +423,13 @@
419424 if( $this->opts->getValue( 'hidebots' ) ) {
420425 $conds['rc_bot'] = 0;
421426 }
422 -
 427+ if( $this->opts->getValue( 'hideown' ) ) {
 428+ if( $wgUser->getId() ) {
 429+ $conds[] = 'rc_user != ' . $dbr->addQuotes( $wgUser->getId() );
 430+ } else {
 431+ $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() );
 432+ }
 433+ }
423434 if ( $this->opts->getValue( 'hideredirs' ) ) {
424435 $conds['page_is_redirect'] = 0;
425436 }
Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -1162,10 +1162,14 @@
11631163 );
11641164
11651165 $toggles[] = 'hideminor';
 1166+ $toggles[] = 'rc_hidebots';
 1167+ $toggles[] = 'newpageshidebots';
11661168 if( $wgUseRCPatrol ) {
11671169 $toggles[] = 'hidepatrolled';
11681170 $toggles[] = 'newpageshidepatrolled';
11691171 }
 1172+ $toggles[] = 'rc_hideown';
 1173+ $toggles[] = 'newpageshideown';
11701174 if( $wgRCShowWatchingUsers ) $toggles[] = 'shownumberswatching';
11711175 $toggles[] = 'usenewrc';
11721176
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -24,11 +24,11 @@
2525 $opts->add( 'from', '' );
2626
2727 $opts->add( 'hideminor', $wgUser->getBoolOption( 'hideminor' ) );
28 - $opts->add( 'hidebots', true );
 28+ $opts->add( 'hidebots', $wgUser->getBoolOption( 'rc_hidebots' ) );
2929 $opts->add( 'hideanons', false );
3030 $opts->add( 'hideliu', false );
3131 $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'hidepatrolled' ) );
32 - $opts->add( 'hidemyself', false );
 32+ $opts->add( 'hidemyself', $wgUser->getBoolOption( 'rc_hideown' ) );
3333
3434 $opts->add( 'namespace', '', FormOptions::INTNULL );
3535 $opts->add( 'invert', false );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -499,8 +499,12 @@
500500 'tog-highlightbroken' => 'Format broken links <a href="" class="new">like this</a> (alternative: like this<a href="" class="internal">?</a>)',
501501 'tog-justify' => 'Justify paragraphs',
502502 'tog-hideminor' => 'Hide minor edits in recent changes',
 503+'tog-rc_hidebots' => 'Hide bot edits in recent changes',
 504+'tog-newpageshidebots' => 'Hide bot edits from new page list',
503505 'tog-hidepatrolled' => 'Hide patrolled edits in recent changes',
504506 'tog-newpageshidepatrolled' => 'Hide patrolled pages from new page list',
 507+'tog-rc_hideown' => 'Hide my own edits in recent changes',
 508+'tog-newpageshideown' => 'Hide my own edits from new page list',
505509 'tog-extendwatchlist' => 'Expand watchlist to show all changes, not just the most recent',
506510 'tog-usenewrc' => 'Enhanced recent changes (requires JavaScript)',
507511 'tog-numberheadings' => 'Auto-number headings',
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -327,8 +327,12 @@
328328 'tog-highlightbroken' => 'Links auf nicht vorhandene Seiten hervorheben <a href="" class="new">Beispiel</a> (Alternative: wie dieser<a href="" class="internal">?</a>)',
329329 'tog-justify' => 'Text als Blocksatz',
330330 'tog-hideminor' => 'Kleine Änderungen ausblenden',
 331+'tog-rc_hidebots' => 'Änderungen der Bots ausblenden',
 332+'tog-newpageshidebots' => 'Änderungen der Bots auf der Liste „Neue Seiten“ verbergen',
331333 'tog-hidepatrolled' => 'Kontrollierte Änderungen in den „Letzten Änderungen“ ausblenden',
332334 'tog-newpageshidepatrolled' => 'Kontrollierte Seiten auf der Liste „Neue Seiten“ verbergen',
 335+'tog-rc_hideown' => 'Eigene Änderungen in den „Letzten Änderungen“ ausblenden',
 336+'tog-newpageshideown' => 'Eigene Änderungen in der Liste „Neue Seiten“ verbergen',
333337 'tog-extendwatchlist' => 'Erweiterte Beobachtungsliste zur Anzeige aller Änderungen',
334338 'tog-usenewrc' => 'Erweiterte Darstellung (benötigt JavaScript)',
335339 'tog-numberheadings' => 'Überschriften automatisch nummerieren',
Index: trunk/phase3/RELEASE-NOTES
@@ -170,6 +170,8 @@
171171 * Special:AllPages: Move hardcoded styles from code to CSS
172172 * (bug 6092) Add parser function equivalents of {{REVISIONID}},
173173 {{REVISIONTIMESTAMP}} (and friends) and {{REVISIONUSER}} magic words
 174+* (bug 7039) Show/hide bots/own edits from Recentchanges via preferences
 175+* Show/hide bots/own edits from Newpage via preferences
174176
175177 === Bug fixes in 1.15 ===
176178 * (bug 16968) Special:Upload no longer throws useless warnings.

Follow-up revisions

RevisionCommit summaryAuthorDate
r49647Follow up r49646: Add new message keys to messages.incraymond19:01, 19 April 2009
r49650Follow-up to r49646: Untested fix for the problem that bots are now not hidde...rotem20:30, 19 April 2009
r49651Reverting r49646 (and followups r49647 r49650) per comments on code review:...demon21:03, 19 April 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45857(bug 16957) Add show/hide to Preferences for option on Special:NewPagesaaron00:01, 18 January 2009

Comments

#Comment by 😂 (talk | contribs)   19:28, 19 April 2009

Suggest reversion until the new preference branch is merged into trunk.

#Comment by Nikerabbit (talk | contribs)   19:50, 19 April 2009

To reduce the preference clutter, would it be possible to at least have only a single setting per type for both pages (recentchanges and newpages)?

#Comment by Rotemliss (talk | contribs)   20:35, 19 April 2009

After testing: I fixed in r49650 the default value (of "hide bots in recent changes") problem for anonymous (and newly-registered) users only; solving the problem for registered users might require changing the preference to be positive, i.e. "show bots in recent changes".

#Comment by Purodha (talk | contribs)   22:57, 19 April 2009

I decided, not to make it different from the rest of those toggles for now, leaving this for a more unified handling after the restructured preferencees. I believe, wording of the options should be either positive or negative all the time, because mixed wording would be bewildering. Only defaults should be different, imho.

#Comment by Siebrand (talk | contribs)   20:42, 19 April 2009

preferences for Special:NewPages should *not* be in the Recent Changes tab of Special:Preferences...

#Comment by Purodha (talk | contribs)   23:23, 19 April 2009

I agree. They were there before, and I did not move them for now. The reason being that I saw, we can likely have almost or all of the toggles for "recent changes", and "new pages", and "watchlist" filters unified, and largely handled by common subroutines. (Too big a task for today, though) See https://bugzilla.wikimedia.org/show_bug.cgi?id=18524

Status & tagging log