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

Stop passing $ids to membership::create #26373

Merged
merged 1 commit into from
Jun 5, 2023
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
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