From dfe4b2f51fc7d87a4e0efc730376fef91ea99c92 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 30 Apr 2013 22:12:44 +1200 Subject: [PATCH] CRM-12472 - Custom tables being needlessly left joined into reports if they include a date field --- CRM/Report/Form.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index fef2c7232c..296afcd100 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -2817,8 +2817,10 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a foreach (array( 'value', 'min', 'max', 'relative', 'from', 'to') as $attach) { if (isset($this->_params[$fieldAlias . '_' . $attach]) && - (!empty($this->_params[$fieldAlias . '_' . $attach]) || $this->_params[$fieldAlias . '_' . $attach] == '0') - ) { + (!empty($this->_params[$fieldAlias . '_' . $attach]) + || ($attach != 'relative' && $this->_params[$fieldAlias . '_' . $attach] == '0') + ) + ){ return TRUE; } } -- 2.25.1