mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 19:53:44 +00:00
Fix for #4625
This commit is contained in:
@@ -75,6 +75,9 @@ class CurrencyForm
|
|||||||
|
|
||||||
// perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount)
|
// perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount)
|
||||||
$preFilled = session('preFilled');
|
$preFilled = session('preFilled');
|
||||||
|
if (!is_array($preFilled)) {
|
||||||
|
$preFilled = [];
|
||||||
|
}
|
||||||
$key = 'amount_currency_id_' . $name;
|
$key = 'amount_currency_id_' . $name;
|
||||||
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int)$preFilled[$key] : $defaultCurrency->id;
|
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int)$preFilled[$key] : $defaultCurrency->id;
|
||||||
|
|
||||||
@@ -140,7 +143,10 @@ class CurrencyForm
|
|||||||
unset($options['currency'], $options['placeholder']);
|
unset($options['currency'], $options['placeholder']);
|
||||||
|
|
||||||
// perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount)
|
// perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount)
|
||||||
$preFilled = session('preFilled');
|
$preFilled = session('preFilled');
|
||||||
|
if (!is_array($preFilled)) {
|
||||||
|
$preFilled = [];
|
||||||
|
}
|
||||||
$key = 'amount_currency_id_' . $name;
|
$key = 'amount_currency_id_' . $name;
|
||||||
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int)$preFilled[$key] : $defaultCurrency->id;
|
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int)$preFilled[$key] : $defaultCurrency->id;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user