Switch to non-deprecated/cached functions for membership pricesets
authorMatthew Wire <mjw@mjwconsult.co.uk>
Mon, 7 Sep 2020 15:32:40 +0000 (16:32 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Wed, 23 Sep 2020 09:43:26 +0000 (10:43 +0100)
CRM/Price/Form/Field.php

index 1225b94be6af3f8739abd5e45bea4c15660fd7f5..a7f7420f9a1444f7e7b00317b446a087c9f71e6b 100644 (file)
@@ -556,12 +556,12 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
             $foundDuplicate = FALSE;
             $orgIds = [];
             foreach ($memTypesIDS as $key => $val) {
-              $org = CRM_Member_BAO_MembershipType::getMembershipTypeOrganization($val);
-              if (in_array($org[$val], $orgIds)) {
+              $memTypeDetails = CRM_Member_BAO_MembershipType::getMembershipType($val);
+              if (in_array($memTypeDetails['member_of_contact_id'], $orgIds)) {
                 $foundDuplicate = TRUE;
                 break;
               }
-              $orgIds[$val] = $org[$val];
+              $orgIds[$val] = $memTypeDetails['member_of_contact_id'];
 
             }
             if ($foundDuplicate) {
@@ -573,7 +573,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
           $foundAutorenew = FALSE;
           foreach ($memTypesIDS as $key => $val) {
             // see if any price field option values in this price field are for memberships with autorenew
-            $memTypeDetails = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($val);
+            $memTypeDetails = CRM_Member_BAO_MembershipType::getMembershipType($val);
             if (!empty($memTypeDetails['auto_renew'])) {
               $foundAutorenew = TRUE;
               break;