From c3889fe0510c22ae9bd208d4f3d953fac8ecdfef Mon Sep 17 00:00:00 2001 From: bellord13 Date: Sat, 27 Apr 2024 02:25:45 +0300 Subject: [PATCH] fix --- templates/form/field/input/edit.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/form/field/input/edit.php b/templates/form/field/input/edit.php index 17434db..91d4ff1 100644 --- a/templates/form/field/input/edit.php +++ b/templates/form/field/input/edit.php @@ -12,18 +12,20 @@ if(mb_strlen($field->getId())){ if($bLabel){?>isMultiple()){ - foreach ($field->getValue() as $value){ + $values = $field->getValue(); + if(!is_array($values)){ + $values = []; + } + if(!count($values)){ + $values[] = ''; + } + foreach ($values as $value){ $inputAttributes = $field->getAttributes(); $inputAttributes['name'] .= '[]'; $inputAttributes['value'] = $value; ?>>getAttributes(); - $inputAttributes['name'] .= '[]'; - $inputAttributes['value'] = ''; - ?>>getAttributes(); $inputAttributes['data-dirty'] = $field->isDirty()?'true':'false';