[BUGFIX] Parent language is not applied to new child records 48/30448/2
authorDavid Greiner <hallo@davidgreiner.de>
Tue, 27 May 2014 14:07:41 +0000 (16:07 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 28 May 2014 12:11:28 +0000 (14:11 +0200)
If localizing a parent-child structure, usually the language
of the parent element shall be applied to related child records
as well as new child records.

Due to a missing array segment, the accordant section in the
the InlineElement source code never was processed.

Resolves: #57063
Releases: 6.2, 6.1
Change-Id: I7e563044f9889538f9b8171f71f7685722db8266
Reviewed-on: https://review.typo3.org/30448
Reviewed-by: Markus Klein
Reviewed-by: David Greiner
Reviewed-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/backend/Classes/Form/Element/InlineElement.php

index d1c3ebd..846a778 100644 (file)
@@ -1226,7 +1226,7 @@ class InlineElement {
                                }
                        }
                        // Set language of new child record to the language of the parent record:
-                       if ($config['localizationMode'] == 'select') {
+                       if ($parent['localizationMode'] === 'select') {
                                $parentRecord = $this->getRecord(0, $parent['table'], $parent['uid']);
                                $parentLanguageField = $GLOBALS['TCA'][$parent['table']]['ctrl']['languageField'];
                                $childLanguageField = $GLOBALS['TCA'][$current['table']]['ctrl']['languageField'];