From 5b7c52cfbc1b4abd84e62b63bc8fe698444fe0d3 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 14 May 2015 22:18:10 +0000 Subject: [PATCH] Minor fixes found in testing --- CRM/Contact/Form/Search/Custom/ContribSYBNT.php | 3 +-- CRM/Contact/Form/Search/Custom/ContributionAggregate.php | 4 ++-- CRM/Contact/Form/Search/Custom/EventAggregate.php | 3 +++ CRM/Contact/Form/Search/Custom/PostalMailing.php | 2 +- CRM/Contact/Form/Search/Custom/ZipCodeRange.php | 2 -- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index dac043e9e1..1d51a84d71 100644 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -341,8 +341,7 @@ AND c.receive_date < {$this->start_date_1} $clauses[] = " xg.contact_id IS NULL "; } - - return "{$this->_where} AND " . implode(' AND ', $clauses); + return implode(' AND ', $clauses); } /** diff --git a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php index c85a5e1624..519be745de 100644 --- a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@ -182,7 +182,7 @@ $having $this->buildACLClause('contact_a'); $from = " civicrm_contribution AS contrib, -civicrm_contact AS contact_a {$this->aclFrom} +civicrm_contact AS contact_a {$this->_aclFrom} "; if ($this->_aclWhere) { $this->_where .= " {$this->_aclWhere} "; @@ -234,7 +234,7 @@ civicrm_contact AS contact_a {$this->aclFrom} $clauses[] = "contrib.financial_type_id IN ($financial_type_ids)"; } - return "{$this->_where} AND " . implode(' AND ', $clauses); + return implode(' AND ', $clauses); } /** diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php index 970d110a1a..5eb28b8a18 100644 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -194,6 +194,9 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea left join civicrm_participant on civicrm_participant_payment.participant_id=civicrm_participant.id + left join civicrm_contact contact_a + on civicrm_participant.contact_id = contact_a.id + left join civicrm_event on civicrm_participant.event_id = civicrm_event.id diff --git a/CRM/Contact/Form/Search/Custom/PostalMailing.php b/CRM/Contact/Form/Search/Custom/PostalMailing.php index 027b909593..0f33fc6692 100644 --- a/CRM/Contact/Form/Search/Custom/PostalMailing.php +++ b/CRM/Contact/Form/Search/Custom/PostalMailing.php @@ -152,7 +152,7 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address. $clause[] = "contact_a.contact_type IN ('Individual','Household')"; if (!empty($clause)) { - $where = "{$this->_where} AND " . implode(' AND ', $clause); + $where = implode(' AND ', $clause); } return $this->whereClause($where, $params); diff --git a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php index a25a22e127..8ca17281b9 100644 --- a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php +++ b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php @@ -175,8 +175,6 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND 2 => array(trim($high), 'Integer'), ); - $where .= "{$this->_where} "; - return $this->whereClause($where, $params); } -- 2.25.1