Skip to content

Commit

Permalink
Stop passing to membership::create
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed May 29, 2023
1 parent 8256036 commit b10cfaf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -1000,15 +1000,15 @@ public function submit(): void {
$this->storeContactFields($this->_params);
$this->beginPostProcess();

$params = $softParams = $ids = [];
$params = $softParams = [];

$mailSend = FALSE;
$this->processBillingAddress();
$formValues = $this->_params;
$formValues = $this->setPriceSetParameters($formValues);

if ($this->_id) {
$ids['membership'] = $params['id'] = $this->_id;
$params['id'] = $this->_id;
}

// Set variables that we normally get from context.
Expand Down Expand Up @@ -1282,8 +1282,7 @@ public function submit(): void {
unset($membershipParams['contribution_status_id']);
$membershipParams['skipLineItem'] = TRUE;
unset($membershipParams['lineItems']);
// @todo stop passing $ids (membership and userId only are set above)
$this->setMembership((array) CRM_Member_BAO_Membership::create($membershipParams, $ids));
$this->setMembership((array) CRM_Member_BAO_Membership::create($membershipParams));
$lineItem[$this->_priceSetId][$id]['entity_id'] = $this->membership['id'];
$lineItem[$this->_priceSetId][$id]['entity_table'] = 'civicrm_membership';

Expand Down

0 comments on commit b10cfaf

Please sign in to comment.