From 4755bcde43cdb3c464a12c42ef73b01c0ad0b4a1 Mon Sep 17 00:00:00 2001 From: yashodha Date: Wed, 24 Dec 2014 14:42:57 +0530 Subject: [PATCH] CRM-15732 : fix looking up deleted 'On behalf' orgs ---------------------------------------- * CRM-15732: Donations with an On Behalf Of an organization profile dedupes with contacts in the trash https://issues.civicrm.org/jira/browse/CRM-15732 --- CRM/Contact/BAO/Relationship.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 37431862a9..27971c6290 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -1493,7 +1493,8 @@ cr.relationship_type_id IN (%2) AND cr.is_permission_a_b = 1 AND IF(cr.end_date IS NULL, 1, (DATEDIFF( CURDATE( ), cr.end_date ) <= 0)) AND cr.is_active = 1 AND -cc.id = cr.contact_id_b"; +cc.id = cr.contact_id_b AND +cc.is_deleted = 0"; if (!empty($name)) { $name = CRM_Utils_Type::escape($name, 'String'); -- 2.25.1