[BUGFIX] Check Tsconfig in page module for value of content element 89/58889/2
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 13 Nov 2018 12:46:53 +0000 (13:46 +0100)
committerBenni Mack <benni@typo3.org>
Wed, 14 Nov 2018 05:24:22 +0000 (06:24 +0100)
In case a content element is added with TsConfig its label can't be
loaded from TCA but the TsConfig must be checked.

Resolves: #86909
Releases: master, 8.7
Change-Id: I2de2b73dcd4799a45aece330f377e86bd2bf596f
Reviewed-on: https://review.typo3.org/58889
Reviewed-by: Soren Malling <soren@meteko.dk>
Tested-by: Soren Malling <soren@meteko.dk>
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/View/PageLayoutView.php

index 25d90c9..e806452 100644 (file)
@@ -878,6 +878,7 @@ class PageLayoutView implements LoggerAwareInterface
         foreach ($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'] as $val) {
             $this->CType_labels[$val[1]] = $this->getLanguageService()->sL($val[0]);
         }
+
         $this->itemLabels = [];
         foreach ($GLOBALS['TCA']['tt_content']['columns'] as $name => $val) {
             $this->itemLabels[$name] = $this->getLanguageService()->sL($val['label']);
@@ -2293,8 +2294,11 @@ class PageLayoutView implements LoggerAwareInterface
                     break;
                 default:
                     $contentType = $this->CType_labels[$row['CType']];
+                    if (!isset($contentType)) {
+                        $contentType =  BackendUtility::getLabelFromItemListMerged($row['pid'], 'tt_content', 'CType', $row['CType']);
+                    }
 
-                    if (isset($contentType)) {
+                    if ($contentType) {
                         $out .= $this->linkEditContent('<strong>' . htmlspecialchars($contentType) . '</strong>', $row) . '<br />';
                         if ($row['bodytext']) {
                             $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';