dev/core/issues/202, check if default currency is set
authorPradeep Nayak <pradpnayak@gmail.com>
Fri, 22 Jun 2018 14:20:39 +0000 (15:20 +0100)
committerPradeep Nayak <pradpnayak@gmail.com>
Fri, 22 Jun 2018 14:20:39 +0000 (15:20 +0100)
CRM/Core/Form.php

index ce004204d6f0bbb0f982c1f7c67898f3cc607113..abfbcdfcd44236ebd000ba53e94106db9beea29a 100644 (file)
@@ -1868,7 +1868,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     $setDefaultCurrency = TRUE
   ) {
     $currencies = CRM_Core_OptionGroup::values('currencies_enabled');
-    if (!array_key_exists($defaultCurrency, $currencies)) {
+    if (!empty($defaultCurrency) && !array_key_exists($defaultCurrency, $currencies)) {
       Civi::log()->warning('addCurrency: Currency ' . $defaultCurrency . ' is disabled but still in use!');
       $currencies[$defaultCurrency] = $defaultCurrency;
     }