From: Stephane Bisson Date: Mon, 8 May 2017 12:58:05 +0000 (-0400) Subject: RC Filters: Single boolean filters are not contradictory X-Git-Tag: 1.31.0-rc.0~3303^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=12c4c79b6e3c0aa308acd3260c88dbeaee76d3f3;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;