Skip to content

Commit

Permalink
[REF] minor fix - move last of processing before receipting
Browse files Browse the repository at this point in the history
The moved items are in the middle of a long chunk that just deals with receipting  & message setting
  • Loading branch information
eileenmcnaughton committed Jul 28, 2021
1 parent e2ffbae commit dd264f6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,9 @@ public function submit(): void {
CRM_Member_BAO_Membership::recordMembershipContribution($params);
}
}

$this->updateContributionOnMembershipTypeChange($params);

if (($this->_action & CRM_Core_Action::UPDATE)) {
$this->addStatusMessage($this->getStatusMessageForUpdate());
}
Expand Down Expand Up @@ -1384,17 +1387,16 @@ public function submit(): void {
$receiptSent = TRUE;
}

// finally set membership id if already not set
if (!$this->_id) {
$this->_id = $this->getMembershipID();
}

$this->updateContributionOnMembershipTypeChange($params);
if ($receiptSent && $mailSend) {
$this->addStatusMessage(ts('A membership confirmation and receipt has been sent to %1.', [1 => $this->_contributorEmail]));
}

CRM_Core_Session::setStatus($this->getStatusMessage(), ts('Complete'), 'success');

// finally set membership id if already not set
if (!$this->_id) {
$this->_id = $this->getMembershipID();
}
$this->setStatusMessage();
}

Expand Down

0 comments on commit dd264f6

Please sign in to comment.