Don't show deleted contacts CRM-10012
authorColeman Watts <coleman@civicrm.org>
Tue, 9 Apr 2013 21:45:11 +0000 (14:45 -0700)
committerColeman Watts <coleman@civicrm.org>
Tue, 9 Apr 2013 21:45:11 +0000 (14:45 -0700)
CRM/Member/Page/Tab.php

index d41eeee49a02a0c0189bbd761716b71a7bf899fa..cca688288667d1e97b6bb61db0fa20defdb994d2 100644 (file)
@@ -152,7 +152,8 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
  SELECT COUNT(m.id)
    FROM civicrm_membership m
      LEFT JOIN civicrm_membership_status ms ON ms.id = m.status_id
-  WHERE m.owner_membership_id = {$dao->id} AND m.is_test = 0 AND ms.is_current_member = 1";
+     LEFT JOIN civicrm_contact ct ON ct.id = m.contact_id
+  WHERE m.owner_membership_id = {$dao->id} AND m.is_test = 0 AND ms.is_current_member = 1 AND ct.is_deleted = 0";
         $num_related = CRM_Core_DAO::singleValueQuery($query);
         $max_related = CRM_Utils_Array::value('max_related', $membership[$dao->id]);
         $membership[$dao->id]['related_count'] = ($max_related == '' ?