From: eileen Date: Thu, 15 Feb 2024 23:16:10 +0000 (+1300) Subject: dev/core#5007 Fix failure to assign default membership to quick config price set X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ebf18485be6335fbc572e704410e46c2d6a9b59b;p=civicrm-core.git dev/core#5007 Fix failure to assign default membership to quick config price set --- diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 04279378a7..bbdb41256b 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -242,7 +242,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $memtypeID = NULL; if ($this->_priceSetId) { - if ($this->isMembershipPriceSet()) { + if ($this->getFormContext() === 'membership') { $selectedCurrentMemTypes = []; foreach ($this->_priceSet['fields'] as $key => $val) { foreach ($val['options'] as $keys => $values) { @@ -926,6 +926,9 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $errors["price_{$otherAmount}"] = ts('Amount is required field.'); } + // @todo - this should probably be $this->getFormContext() === 'membership' + // which would make it apply to quick config & non quick config. + // See https://lab.civicrm.org/dev/core/-/issues/3314 if ($self->isMembershipPriceSet() && !empty($check) && $membershipIsActive) { $priceFieldIDS = []; $priceFieldMemTypes = [];