From ec25c488226f49ac75daaea44bc187898f311630 Mon Sep 17 00:00:00 2001 From: Francis Whittle Date: Wed, 31 Oct 2018 12:50:25 +1100 Subject: [PATCH] Do not show "My Cases" where relationship is inactive in case search. --- CRM/Case/BAO/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Case/BAO/Query.php b/CRM/Case/BAO/Query.php index 0a2bb28275..0e7be9f8ec 100644 --- a/CRM/Case/BAO/Query.php +++ b/CRM/Case/BAO/Query.php @@ -296,7 +296,7 @@ class CRM_Case_BAO_Query extends CRM_Core_BAO_Query { if ($value == 2) { $session = CRM_Core_Session::singleton(); $userID = $session->get('userID'); - $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("case_relationship.contact_id_b", $op, $userID, 'Int'); + $query->_where[$grouping][] = ' ( ' . CRM_Contact_BAO_Query::buildClause("case_relationship.contact_id_b", $op, $userID, 'Int') . ' AND ' . CRM_Contact_BAO_Query::buildClause("case_relationship.is_active", '<>', 0, 'Int') . ' ) '; $query->_qill[$grouping][] = ts('Case %1 My Cases', array(1 => $op)); $query->_tables['case_relationship'] = $query->_whereTables['case_relationship'] = 1; } -- 2.25.1