$allStatus = CRM_Member_PseudoConstant::membershipStatus();
$membershipTypeDetails = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($membershipTypeID);
$ids = [];
-
- // CRM-7297 - allow membership type to be be changed during renewal so long as the parent org of new membershipType
- // is the same as the parent org of an existing membership of the contact
- $currentMembership = CRM_Member_BAO_Membership::getContactMembership($contactID, $membershipTypeID,
- $is_test, $membershipID, TRUE
- );
+ $currentMembership = civicrm_api3('Membership', 'getsingle', ['id' => $membershipID]);
// Do NOT do anything.
//1. membership with status : PENDING/CANCELLED (CRM-2395)
// CRM-15475
array_search('Cancelled', CRM_Member_PseudoConstant::membershipStatus(NULL, " name = 'Cancelled' ", 'name', FALSE, TRUE)),
])) {
-
$memParams = [
'id' => $currentMembership['id'],
'status_id' => $currentMembership['status_id'],
// Check and fix the membership if it is STALE
CRM_Member_BAO_Membership::fixMembershipStatusBeforeRenew($currentMembership, $changeToday);
- $isMembershipCurrent = $currentMembership['is_current_member'];
+ $isMembershipCurrent = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $currentMembership['status_id'], 'is_current_member');
// CRM-7297 Membership Upsell - calculate dates based on new membership type
$dates = CRM_Member_BAO_MembershipType::getRenewalDatesForMembershipType($currentMembership['id'],