diff --git a/src/Controller/Backend/ContentEditController.php b/src/Controller/Backend/ContentEditController.php index 30fe890db..b6fc568de 100644 --- a/src/Controller/Backend/ContentEditController.php +++ b/src/Controller/Backend/ContentEditController.php @@ -459,13 +459,13 @@ public function updateCollections(Content $content, array $formData, ?string $lo $collection = $this->getFieldToUpdate($content, $collectionName, $collectionDefinition); + $newFields = []; foreach ($collectionItems as $name => $instances) { // order field is only used to determine the order in which fields are submitted if ($name === 'order') { continue; } - $newFields = []; foreach ($instances as $orderId => $value) { $order = $orderArray[$orderId]; $fieldDefinition = $collection->getDefinition()->get('fields')->get($name); @@ -478,8 +478,8 @@ public function updateCollections(Content $content, array $formData, ?string $lo $this->updateField($field, $value, $locale); $tm->applyTranslations($field, $collectionName, $orderId); } - $collection->setValue($newFields); } + $collection->setValue($newFields); } } }