ChangesListStringOptionsFilter: Make isSelected() respect ALL
authorRoan Kattouw <roan.kattouw@gmail.com>
Mon, 17 Jul 2017 23:52:51 +0000 (16:52 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Mon, 17 Jul 2017 23:52:51 +0000 (16:52 -0700)
ChangesListStringOptionsGroup::modifyQuery checks for ALL and
behaves accordingly, but isSelected() didn't. This broke conflict
detection when an entire non-full-coverage group was selected.

Bug: T162630
Change-Id: Ie241744201380ca5450d5edbb3eba971194f3df4

includes/changes/ChangesListStringOptionsFilter.php

index 6754d67..76d0bef 100644 (file)
@@ -19,10 +19,12 @@ class ChangesListStringOptionsFilter extends ChangesListFilter {
         * @inheritdoc
         */
        public function isSelected( FormOptions $opts ) {
-               $values = explode(
-                       ChangesListStringOptionsFilterGroup::SEPARATOR,
-                       $opts[ $this->getGroup()->getName() ]
-               );
+               $option = $opts[ $this->getGroup()->getName() ];
+               if ( $option === ChangesListStringOptionsFilterGroup::ALL ) {
+                       return true;
+               }
+
+               $values = explode( ChangesListStringOptionsFilterGroup::SEPARATOR, $option );
                return in_array( $this->getName(), $values );
        }
 }