[BUGFIX] Check Tsconfig in page module for value of content element 92/58892/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 19:40:30 +0000 (20:40 +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/58892
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index c403c7d..be0f3b9 100644 (file)
@@ -482,6 +482,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         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']);
@@ -1883,8 +1884,11 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     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 />';