[BUGFIX] Make sure correct sys_language_uid is set for irre items 70/53570/2
authorFrans Saris <franssaris@gmail.com>
Thu, 6 Jul 2017 12:55:04 +0000 (14:55 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 24 Jul 2017 06:27:58 +0000 (08:27 +0200)
Resolves: #76440
Releases: master, 8.7, 7,6
Change-Id: I519641eadd3342369b66252da2d50ca54726aacb
Reviewed-on: https://review.typo3.org/53570
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInlineConfiguration.php

index 091c163..464ba23 100644 (file)
@@ -229,10 +229,15 @@ class TcaInlineConfiguration implements FormDataProviderInterface
 
         $parentLanguageField = $result['processedTca']['ctrl']['languageField'];
         if (!isset($parentConfig['inline']['parentSysLanguageUid'])
-            && isset($result['databaseRow'][$parentLanguageField][0])
+            && isset($result['databaseRow'][$parentLanguageField])
         ) {
-            $result['processedTca']['columns'][$fieldName]['config']['inline']['parentSysLanguageUid']
-                = (int)$result['databaseRow'][$parentLanguageField][0];
+            if (is_array($result['databaseRow'][$parentLanguageField])) {
+                $result['processedTca']['columns'][$fieldName]['config']['inline']['parentSysLanguageUid']
+                    = (int)$result['databaseRow'][$parentLanguageField][0];
+            } else {
+                $result['processedTca']['columns'][$fieldName]['config']['inline']['parentSysLanguageUid']
+                    = (int)$result['databaseRow'][$parentLanguageField];
+            }
         }
 
         return $result;