[TASK] Improve rendering of non existent content types
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 5 Nov 2012 23:23:46 +0000 (00:23 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 9 Nov 2012 04:38:51 +0000 (05:38 +0100)
If a custom content element is created by using
an extension and the ext is removed, an empty content
element is rendered in the page module.

Now the same warning is shown as if a non existent
plugin is rendered

Change-Id: Ib98ff3fdf17d7383b51e6c108854a2fc34d5def4
Resolves: #42510
Releases: 6.0
Reviewed-on: http://review.typo3.org/16223
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Reviewed-by: Wouter Wolters
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/backend/Classes/View/PageLayoutView.php

index 2d537dd..e2b4808 100644 (file)
@@ -1322,7 +1322,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                $out .=  '<strong>' . $GLOBALS['LANG']->sL($label, TRUE) . '</strong><br />';
                                        } else {
                                                $message = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.noMatchingValue'), $row['list_type']);
-                                               $out .= \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $message, '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING)->render();
+                                               $out .= \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($message), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING)->render();
                                        }
                                } elseif (!empty($row['select_key'])) {
                                        $out .= $GLOBALS['LANG']->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel('tt_content', 'select_key'), 1) . ' ' . $row['select_key'] . '<br />';
@@ -1337,9 +1337,16 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                $out .= '<br />' . $this->linkEditContent($this->renderText($row['imagecaption']), $row) . '<br />';
                                break;
                        default:
-                               $out .= '<strong>' . htmlspecialchars($this->CType_labels[$row['CType']]) . '</strong><br />';
-                               if ($row['bodytext']) {
-                                       $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
+                               $contentType = $this->CType_labels[$row['CType']];
+
+                               if (isset($contentType)) {
+                                       $out .= '<strong>' . htmlspecialchars($contentType) . '</strong><br />';
+                                       if ($row['bodytext']) {
+                                               $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
+                                       }
+                               } else {
+                                       $message = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.noMatchingValue'), $row['CType']);
+                                       $out .= \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($message), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING)->render();
                                }
                                break;
                        }