From 2419a5752eaeba0f9966de6ddfa9056ad54fce00 Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Wed, 31 Oct 2018 23:04:01 +0530 Subject: [PATCH] added missed clause --- CRM/ConstituentsOnly/BAO/Query.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CRM/ConstituentsOnly/BAO/Query.php b/CRM/ConstituentsOnly/BAO/Query.php index f3013d3..d068f6f 100644 --- a/CRM/ConstituentsOnly/BAO/Query.php +++ b/CRM/ConstituentsOnly/BAO/Query.php @@ -65,6 +65,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface { LEFT JOIN civicrm_contact cc1 ON (cr.contact_id_a = cc1.id) WHERE contact_a.do_not_trade = 1 AND (cr.id IS NULL OR cc1.is_deleted = 1 OR cc1.do_not_trade = 1) + AND contact_a.id <> cc1.id UNION SELECT contact_a.id FROM civicrm_contact contact_a @@ -74,6 +75,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface { LEFT JOIN civicrm_contact cc1 ON (cr.contact_id_b = cc1.id) WHERE contact_a.do_not_trade = 1 AND (cr.id IS NULL OR cc1.is_deleted = 1 OR cc1.do_not_trade = 1) + AND contact_a.id <> cc1.id ) AS temp GROUP BY id ) ";