From d01db0d40e045c09b550274736d19ce2639c15b1 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 3 Nov 2021 17:43:48 +0000 Subject: [PATCH] Fix undefined currency on event registration --- CRM/Price/BAO/PriceField.php | 1 + api/v3/utils.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 244a32fbe4..bac6d7a1a6 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -274,6 +274,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $config = CRM_Core_Config::singleton(); $currencySymbol = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_Currency', $config->defaultCurrency, 'symbol', 'name'); $qf->assign('currencySymbol', $currencySymbol); + $qf->assign('currency', $config->defaultCurrency); // get currency name for price field and option attributes $currencyName = $config->defaultCurrency; diff --git a/api/v3/utils.php b/api/v3/utils.php index 9415938513..93b899b5e0 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -2244,7 +2244,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti if ($fieldName == 'currency') { //When using IN operator $fieldValue is a array of currency codes if (!CRM_Utils_Rule::currencyCode($value)) { - throw new Exception("Currency not a valid code: $currency"); + throw new Exception("Currency not a valid code: $value"); } } } -- 2.25.1