From 860c6eaaad8b5c03a539fd26f9dfbad633bb00bc Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Tue, 18 Jul 2023 12:56:15 -0600 Subject: [PATCH] Fix price set select broken price attr regression --- CRM/Price/BAO/PriceField.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index bb5aeb9a40..1a1676e957 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -445,11 +445,12 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { break; case 'Select': - $selectOption = $allowedOptions = []; + $selectOption = $allowedOptions = $priceVal = []; foreach ($customOption as $opt) { $priceOptionText = self::buildPriceOptionText($opt, $field->is_display_amounts, $valueFieldName); $priceOptionText['label'] = strip_tags($priceOptionText['label']); + $priceVal[$opt['id']] = $priceOptionText['priceVal']; if (!in_array($opt['id'], $freezeOptions)) { $allowedOptions[] = $opt['id']; @@ -484,7 +485,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $element = &$qf->add('select', $elementName, $label, $selectOption, $useRequired && $field->is_required, [ 'placeholder' => ts('- select %1 -', [1 => $label]), - 'price' => json_encode($priceOptionText['priceVal']), + 'price' => json_encode($priceVal), 'class' => 'crm-select2' . $class, 'data-price-field-values' => json_encode($customOption), ]); -- 2.25.1