From ebf18485be6335fbc572e704410e46c2d6a9b59b Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 16 Feb 2024 12:16:10 +1300 Subject: [PATCH] dev/core#5007 Fix failure to assign default membership to quick config price set --- CRM/Contribute/Form/Contribution/Main.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 = []; -- 2.25.1