Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Controller/Backend/ContentEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,6 @@ private function updateField(Field $field, $value, ?string $locale): void
$field->setLocale($this->defaultLocale);
}

// If the value is an array that contains a string of JSON, parse it
if (is_iterable($value) && Json::test(current($value))) {
$value = Json::findArray($value);
}

if ($field instanceof SetField) {
foreach ($value as $name => $svalue) {
$child = $field->getValueForEditor()[$name];
Expand All @@ -438,6 +433,11 @@ private function updateField(Field $field, $value, ?string $locale): void
$this->updateField($child, $svalue, $locale);
}
} else {
// If the value is an array that contains a string of JSON, parse it
if (is_iterable($value) && Json::test(current($value))) {
$value = Json::findArray($value);
}

$field->setValue($value);
}

Expand Down