Skip to content

Commit

Permalink
Merge pull request #26373 from mattwire/noidsmembership
Browse files Browse the repository at this point in the history
Stop passing $ids to membership::create
  • Loading branch information
eileenmcnaughton authored Jun 5, 2023
2 parents 1b75e9e + 9afc564 commit f0db4fc
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 @@ -998,14 +998,14 @@ public function submit(): void {
$this->storeContactFields($this->_params);
$this->beginPostProcess();

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

$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 @@ -1276,8 +1276,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 f0db4fc

Please sign in to comment.