Skip to content

Commit

Permalink
If a currency has been disabled allow the form to be submitted
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Mar 9, 2018
1 parent c6acb33 commit b740ee4
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 b740ee4

Please sign in to comment.