Skip to content

Commit

Permalink
Fix undefined currency on event registration
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Nov 3, 2021
1 parent 6d81fd7 commit 167e1ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CRM/Price/BAO/PriceField.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public static function addQuickFormElement(
$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;

Expand Down
2 changes: 1 addition & 1 deletion api/v3/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
Expand Down

0 comments on commit 167e1ee

Please sign in to comment.