Fix report form isTableSelected to treat relative date filters as filters.
authoreileen <emcnaughton@wikimedia.org>
Tue, 27 Mar 2018 04:30:43 +0000 (17:30 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 27 Mar 2018 04:30:43 +0000 (17:30 +1300)
isTableSelected looks to see if the filter has been passed in. Without this it looks in ->_params[{}_value] &
for {}_op to be null or 'not null' but misses relative date filters.

CRM/Report/Form.php

index 98b0ed3e0e65c12b59688f5de49db43fcd545380..c65b3dd0d72dfcc330d224d7b58ef578f0123177 100644 (file)
@@ -3996,10 +3996,11 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
         }
         if (array_key_exists('filters', $table)) {
           foreach ($table['filters'] as $filterName => $filter) {
-            if (!empty($this->_params["{$filterName}_value"]) ||
-              CRM_Utils_Array::value("{$filterName}_op", $this->_params) ==
-              'nll' ||
-              CRM_Utils_Array::value("{$filterName}_op", $this->_params) ==
+            if (!empty($this->_params["{$filterName}_value"])
+              || !empty($this->_params["{$filterName}_relative"])
+              || CRM_Utils_Array::value("{$filterName}_op", $this->_params) ==
+              'nll'
+              || CRM_Utils_Array::value("{$filterName}_op", $this->_params) ==
               'nnll'
             ) {
               $this->_selectedTables[] = $tableName;