From 7d9f60daadc66ca356862fbeeab6d72d61637422 Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Thu, 10 Sep 2020 15:10:09 -0400 Subject: [PATCH] dev/core#2009 filter grant dashboard to exclude trashed contacts --- CRM/Grant/BAO/Grant.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CRM/Grant/BAO/Grant.php b/CRM/Grant/BAO/Grant.php index d38aeb5c41..e203d546f5 100644 --- a/CRM/Grant/BAO/Grant.php +++ b/CRM/Grant/BAO/Grant.php @@ -25,8 +25,13 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { */ public static function getGrantSummary($admin = FALSE) { $query = " - SELECT status_id, count(id) as status_total - FROM civicrm_grant GROUP BY status_id"; + SELECT status_id, count(g.id) as status_total + FROM civicrm_grant g + JOIN civicrm_contact c + ON g.contact_id = c.id + WHERE c.is_deleted = 0 + GROUP BY status_id + "; $dao = CRM_Core_DAO::executeQuery($query); -- 2.25.1