From 12c4c79b6e3c0aa308acd3260c88dbeaee76d3f3 Mon Sep 17 00:00:00 2001 From: Stephane Bisson Date: Mon, 8 May 2017 08:58:05 -0400 Subject: [PATCH] RC Filters: Single boolean filters are not contradictory When all boolean filters of a group are selected (for example: hideanons && hideliu), we consider the selection unproductive and set them all to false. Some legacy filters are alone in their group (for example: ORES hideDamaging). They should not be considered. Bug: T164625 Change-Id: Ibb6721ccdfb226b3baac7775c30af230c68309e7 --- includes/specialpage/ChangesListSpecialPage.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index 7e70df2028..b1a2d168d2 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -973,13 +973,17 @@ abstract class ChangesListSpecialPage extends SpecialPage { * @return bool True if any option was reset */ private function fixContradictoryOptions( FormOptions $opts ) { - $contradictorySets = []; - $fixed = $this->fixBackwardsCompatibilityOptions( $opts ); foreach ( $this->filterGroups as $filterGroup ) { if ( $filterGroup instanceof ChangesListBooleanFilterGroup ) { $filters = $filterGroup->getFilters(); + + if ( count( $filters ) === 1 ) { + // legacy boolean filters should not be considered + continue; + } + $allInGroupEnabled = array_reduce( $filters, function ( $carry, $filter ) use ( $opts ) { @@ -990,7 +994,7 @@ abstract class ChangesListSpecialPage extends SpecialPage { if ( $allInGroupEnabled ) { foreach ( $filters as $filter ) { - $opts->reset( $filter->getName() ); + $opts[ $filter->getName() ] = false; } $fixed = true; -- 2.20.1