[BUGFIX] IRRE child records cannot be synchronized/localized correctly 19/46819/2
authorOliver Hader <oliver@typo3.org>
Mon, 22 Feb 2016 17:14:29 +0000 (18:14 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 Feb 2016 22:25:14 +0000 (23:25 +0100)
IRRE child records are not synchronized or localized inside a localized
parent record. The DataHandler command contains the target language that
shall be used for the new localized child elements. Since currently an
array is transmitted, all localized children are created for the first
language (sys_language_uid=1), which is the result of "(int)array(123)".

Resolves: #71596
Releases: master, 7.6
Change-Id: Ic34380c7f773449b62bd1e14318f1ea8c081536f
Reviewed-on: https://review.typo3.org/46819
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php

index 7bc1b69..83e239f 100644 (file)
@@ -371,13 +371,20 @@ class FormInlineAjaxController
             $parentLanguage = $parentData['databaseRow'][$parentLanguageField];
             $oldItemList = $parentData['databaseRow'][$parentFieldName];
 
+            // DataHandler cannot handle arrays as field value
+            if (is_array($parentLanguage)) {
+                $parentLanguage = implode(',', $parentLanguage);
+            }
+
             $cmd = array();
+            // Localize a single child element from default language of the parent element
             if (MathUtility::canBeInterpretedAsInteger($type)) {
                 $cmd[$parent['table']][$parent['uid']]['inlineLocalizeSynchronize'] = array(
                     'field' => $parent['field'],
                     'language' => $parentLanguage,
                     'ids' => array($type),
                 );
+            // Either localize or synchronize all child elements from default language of the parent element
             } else {
                 $cmd[$parent['table']][$parent['uid']]['inlineLocalizeSynchronize'] = array(
                     'field' => $parent['field'],