@fuf discovered a bug where FF3 will fall back to the hard-coded system default currency and not the set default currency. See #307

This commit is contained in:
James Cole
2016-09-13 19:19:58 +02:00
parent a7351f348d
commit 6958f71cfd
3 changed files with 14 additions and 10 deletions

View File

@@ -171,7 +171,7 @@ class Amount
}
/**
* @return TransactionCurrency
* @return \FireflyIII\Models\TransactionCurrency
*/
public function getDefaultCurrency(): TransactionCurrency
{
@@ -180,7 +180,7 @@ class Amount
if ($cache->has()) {
return $cache->get();
}
$currencyPreference = Prefs::get('currencyPreference', 'EUR');
$currencyPreference = Prefs::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR'));
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
$cache->store($currency);