From: Stephane Bisson Date: Mon, 14 Nov 2016 18:51:48 +0000 (-0500) Subject: Special:RC filter: hidehumans X-Git-Tag: 1.31.0-rc.0~4648 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_user_edit%27%2C%20iduser=user.userid%29%20%7D%7D?a=commitdiff_plain;h=b33a9844b0f095464c0892daebc0a444ca439375;p=lhc%2Fweb%2Fwiklou.git Special:RC filter: hidehumans Allows showing only bot edits Will be used by the ERI project. Bug: T149862 Change-Id: I748eb3c614abd7b8b228efe3da5e9cb569a8618f --- diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index c1c16854a0..5add448b63 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -141,6 +141,7 @@ abstract class ChangesListSpecialPage extends SpecialPage { $opts->add( 'hideminor', false ); $opts->add( 'hidebots', false ); + $opts->add( 'hidehumans', false ); $opts->add( 'hideanons', false ); $opts->add( 'hideliu', false ); $opts->add( 'hidepatrolled', false ); @@ -238,6 +239,9 @@ abstract class ChangesListSpecialPage extends SpecialPage { if ( $opts['hidebots'] ) { $conds['rc_bot'] = 0; } + if ( $opts['hidehumans'] ) { + $conds[] = 'rc_bot = 1'; + } if ( $user->useRCPatrol() && $opts['hidepatrolled'] ) { $conds['rc_patrolled'] = 0; } diff --git a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php index 388e2fd8a5..0cd1b3432c 100644 --- a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php +++ b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php @@ -267,4 +267,18 @@ class SpecialRecentchangesTest extends MediaWikiTestCase { "rc conditions: hidelog=1" ); } + + public function testRcHidehumans() { + $this->assertConditions( + [ # expected + 'rc_bot' => 1, + "rc_type != '6'", + ], + [ + 'hidebots' => 0, + 'hidehumans' => 1, + ], + "rc conditions: hidebots=0 hidehumans=1" + ); + } }