Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to calling the api #18796

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CRM/Member/BAO/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ public static function sortName($id) {
* @throws \CiviCRM_API3_Exception
*/
public static function createRelatedMemberships($params, $dao) {

unset($params['membership_id']);
$membership = new CRM_Member_DAO_Membership();
$membership->id = $dao->id;

Expand Down Expand Up @@ -1448,11 +1448,10 @@ public static function createRelatedMemberships($params, $dao) {
// CRM-20966: Do not create membership_payment record for inherited membership.
unset($params['relate_contribution_id']);

$ids = [];
if (($params['status_id'] == $deceasedStatusId) || ($params['status_id'] == $expiredStatusId)) {
// related membership is not active so does not count towards maximum
if (!self::hasExistingInheritedMembership($params)) {
CRM_Member_BAO_Membership::create($params);
civicrm_api3('Membership', 'create', $params);
}
}
else {
Expand Down