Sbisson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/321479
Change subject: Special:RC filter: hidehumans
......................................................................
Special:RC filter: hidehumans
Allows showing only bot edits
Will be used by the ERI project.
Bug: T149862
Change-Id: I748eb3c614abd7b8b228efe3da5e9cb569a8618f
---
M includes/specialpage/ChangesListSpecialPage.php
M tests/phpunit/includes/specials/SpecialRecentchangesTest.php
2 files changed, 18 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/79/321479/1
diff --git a/includes/specialpage/ChangesListSpecialPage.php
b/includes/specialpage/ChangesListSpecialPage.php
index 01782f3..421818c 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -141,6 +141,7 @@
$opts->add( 'hideminor', false );
$opts->add( 'hidebots', false );
+ $opts->add( 'hidehumans', false );
$opts->add( 'hideanons', false );
$opts->add( 'hideliu', false );
$opts->add( 'hidepatrolled', false );
@@ -247,6 +248,9 @@
$conds[] = 'rc_user != 0';
}
}
+ if ( $opts['hidehumans'] ) {
+ $conds[] = 'rc_bot = 1';
+ }
if ( $opts['hidemyself'] ) {
if ( $user->getId() ) {
$conds[] = 'rc_user != ' . $dbr->addQuotes(
$user->getId() );
diff --git a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
index b9d3a4b..9af8ad0 100644
--- a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
+++ b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
@@ -139,4 +139,18 @@
[ NS_TALK, NS_MAIN ],
];
}
+
+ public function testRcHidehumans() {
+ $this->assertConditions(
+ [ # expected
+ 'rc_bot' => 1,
+ "rc_type != '6'",
+ ],
+ [
+ 'hidebots' => 0,
+ 'hidehumans' => 1,
+ ],
+ "rc conditions: hidebots=0 hidehumans=1"
+ );
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/321479
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I748eb3c614abd7b8b228efe3da5e9cb569a8618f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits