From ae85876965e8278be9c979e221359febb67b9e7c Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Aug 2018 07:17:18 +0200 Subject: [PATCH] Make sure null value is turned into an empty string [skip ci] --- app/Support/ExpandedForm.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 3f7e706f9e..0370df5f54 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -756,6 +756,7 @@ class ExpandedForm */ public function textarea(string $name, $value = null, array $options = null): string { + $value = $value ?? ''; $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); $classes = $this->getHolderClasses($name); @@ -791,7 +792,7 @@ class ExpandedForm $options['step'] = 'any'; $defaultCurrency = $options['currency'] ?? Amt::getDefaultCurrency(); /** @var Collection $currencies */ - $currencies = app('amount')->getAllCurrencies(); + $currencies = app('amount')->getAllCurrencies(); unset($options['currency'], $options['placeholder']); // perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount)