Revert "[TASK] Avoid slow array functions in loops"
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / DataHandling / Localization / DataMapProcessor.php
index 782f3d9..ed51e0e 100644 (file)
@@ -271,12 +271,14 @@ class DataMapProcessor
      */
     protected function sanitizeTranslationItem(DataMapItem $item)
     {
-        $fieldNames = [[]];
+        $fieldNames = [];
         foreach ($item->getApplicableScopes() as $scope) {
-            $fieldNames[] = $this->getFieldNamesForItemScope($item, $scope, false);
+            $fieldNames = array_merge(
+                $fieldNames,
+                $this->getFieldNamesForItemScope($item, $scope, false)
+            );
         }
 
-        $fieldNames = array_merge(...$fieldNames);
         $fieldNameMap = array_combine($fieldNames, $fieldNames);
         // separate fields, that are submitted in data-map, but not defined as custom
         $this->sanitizationMap[$item->getTableName()][$item->getId()] = array_intersect_key(