Skip to content

Commit

Permalink
Merge pull request #11795 from mattwire/form_disabled_currency
Browse files Browse the repository at this point in the history
dev/financial/5 If a currency has been disabled allow the form to be submitted
  • Loading branch information
eileenmcnaughton authored Mar 12, 2018
2 parents 84c8a58 + b740ee4 commit 5528fa6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Core/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,10 @@ public function addCurrency(
$setDefaultCurrency = TRUE
) {
$currencies = CRM_Core_OptionGroup::values('currencies_enabled');
if (!array_key_exists($defaultCurrency, $currencies)) {
Civi::log()->warning('addCurrency: Currency ' . $defaultCurrency . ' is disabled but still in use!');
$currencies[$defaultCurrency] = $defaultCurrency;
}
$options = array('class' => 'crm-select2 eight');
if (!$required) {
$currencies = array('' => '') + $currencies;
Expand Down

0 comments on commit 5528fa6

Please sign in to comment.