Fix regression on contribution pages when CiviMember is not enabled
authorJon Goldberg <jon@megaphonetech.com>
Fri, 3 Mar 2023 19:37:50 +0000 (14:37 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Fri, 3 Mar 2023 19:37:50 +0000 (14:37 -0500)
CRM/Member/BAO/Membership.php

index e6742c74dd70a9962b88b5049382d5ccba3d6481..15ef6231bb36f2eb323969f045c0ab1be508422c 100644 (file)
@@ -2366,6 +2366,9 @@ WHERE {$whereClause}";
    * @return array
    */
   public static function getAllContactMembership($contactID, $isTest = FALSE, $onlyLifeTime = FALSE) : array {
+    if (!\CRM_Core_Component::isEnabled('CiviMember')) {
+      return [];
+    }
     $contactMembershipType = [];
     if (!$contactID) {
       return $contactMembershipType;