[BUGFIX] Edit a translated record without def. language access 38/58738/3
authorUrsula Klinger <klinger@punkt.de>
Sat, 27 Oct 2018 18:44:25 +0000 (20:44 +0200)
committerBenni Mack <benni@typo3.org>
Sun, 28 Oct 2018 11:37:10 +0000 (12:37 +0100)
Editor without access to default language could not edit a translated
content element, because there was an entry in available languages
for index 0 with null

Resolves: #86771
Releases: master
Change-Id: I608791a6df9b26f420fb233d47f38fe7685931c8
Reviewed-on: https://review.typo3.org/58738
Reviewed-by: Felix Althaus <felix.althaus@undkonsorten.com>
Tested-by: Felix Althaus <felix.althaus@undkonsorten.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Controller/EditDocumentController.php

index 97293d9..70cfcd1 100644 (file)
@@ -2464,9 +2464,15 @@ class EditDocumentController
                     )
                 )
                 ->execute();
-            $availableLanguages = [
-                0 => $allLanguages[0]
-            ];
+
+            $availableLanguages = [];
+
+            if ($allLanguages[0] ?? false) {
+                $availableLanguages = [
+                    0 => $allLanguages[0]
+                ];
+            }
+
             while ($row = $statement->fetch()) {
                 $languageId = (int)$row[$GLOBALS['TCA']['pages']['ctrl']['languageField']];
                 if (isset($allLanguages[$languageId])) {