dont allow pending members to have aliases
authorIan Kelling <iank@fsf.org>
Thu, 30 Jan 2020 23:28:35 +0000 (18:28 -0500)
committerIan Kelling <iank@fsf.org>
Thu, 30 Jan 2020 23:28:35 +0000 (18:28 -0500)
CRM/Memberdashboard/Page/Benefits.php

index ac6bfdb5d58503b49240937556a9f16ea8ac1465..0b69c86f798e27122e49be8b6a46ba16187a738a 100644 (file)
@@ -29,13 +29,15 @@ class CRM_Memberdashboard_Page_Benefits extends CRM_Memberdashboard_Page {
 
   function hasValidMembership() {
     // Since we don't currently shut off an expired member's benefits,
-    // we only test that they have a membership, not that it is current.
+    // we only test that they have a membership, and not that its pending,
+    // because pending members havent yet paid us yet.
     $params = array(
-      'contact_id' => $this->contact['id']
+      'contact_id' => $this->contact['id'],
+      'status_id' => ['!=' => "Pending"]
     );
 
     try {
-      $result = civicrm_api3('membership', 'get', $params);
+      $result = ('membership', 'get', $params);
       return $result['count'] > 0;
     } catch (CiviCRM_API3_Exception $e) {
       return false;