Skip to content

Commit

Permalink
Update FormField.php (#20168)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshiol authored and Michael Babker committed Jul 21, 2018
1 parent 98f947a commit 7ce46ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libraries/src/Form/FormField.php
Expand Up @@ -600,7 +600,14 @@ public function setup(\SimpleXMLElement $element, $value, $group = null)
$this->default = isset($element['value']) ? (string) $element['value'] : $this->default;

// Set the field default value.
$this->value = $value;
if ($element['multiple'] && is_string($value) && is_array(json_decode($value, true)))
{
$this->value = (array) json_decode($value);
}
else
{
$this->value = $value;
}

foreach ($attributes as $attributeName)
{
Expand Down

0 comments on commit 7ce46ec

Please sign in to comment.