From e437ccced468908f0885b6830082e1567a944712 Mon Sep 17 00:00:00 2001 From: Eli Lisseck Date: Thu, 28 Sep 2017 13:06:02 -0400 Subject: [PATCH] CRM-20460 addition to @sunilpawar Fix Grant Report Where clause --- CRM/Report/Form/Grant/Detail.php | 6 +----- CRM/Report/Form/Grant/Statistics.php | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/CRM/Report/Form/Grant/Detail.php b/CRM/Report/Form/Grant/Detail.php index 02c3a0cd9a..03fec11779 100644 --- a/CRM/Report/Form/Grant/Detail.php +++ b/CRM/Report/Form/Grant/Detail.php @@ -285,11 +285,7 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { } } } - - if (empty($clauses)) { - $this->_where = "WHERE ( 1 )"; - } - else { + if (!empty($clauses)) { $this->_where = "WHERE " . implode(' AND ', $clauses); } } diff --git a/CRM/Report/Form/Grant/Statistics.php b/CRM/Report/Form/Grant/Statistics.php index 8516a63968..fa15767cbb 100644 --- a/CRM/Report/Form/Grant/Statistics.php +++ b/CRM/Report/Form/Grant/Statistics.php @@ -300,11 +300,7 @@ WHERE {$this->_aliases['civicrm_grant']}.amount_total IS NOT NULL } } } - - if (empty($clauses)) { - $this->_where = "WHERE ( 1 )"; - } - else { + if (!empty($clauses)) { $this->_where = "WHERE " . implode(' AND ', $clauses); $this->_whereClause = $whereClause . " AND " . implode(' AND ', $clauses); } -- 2.25.1