diff --git a/src/Controller/Backend/ContentEditController.php b/src/Controller/Backend/ContentEditController.php index 3d13a45f6..ed0bb7289 100644 --- a/src/Controller/Backend/ContentEditController.php +++ b/src/Controller/Backend/ContentEditController.php @@ -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]; @@ -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); }