Commit e81619ee authored by Daniel Siepmann's avatar Daniel Siepmann Committed by Georg Ringer
Browse files

[BUGFIX] Render exception for backend preview as error

Prior only an warning was logged, and a fallback rendering jumped in.
With this change an error is rendered in addition to logging. No
fallback will be triggered anymore.

This should raise awareness and ease integration for integrators.
Please note that already broken elements might now show an error
instead of fallback preview.

This is only activated for admin users and enabled BE|debug system

Resolves: #90427
Releases: master
Change-Id: I1f24a1e775ba4f12917ed26dc29b0ea78ab81a1f

Reviewed-by: Susanne Moog's avatarSusanne Moog <>
Reviewed-by: Björn Jacob's avatarBjörn Jacob <>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <>
Reviewed-by: default avatarChristian Eßl <>
Reviewed-by: default avatarIngo Fabbri <>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <>
Tested-by: default avatarTYPO3com <>
Tested-by: default avatarChristian Eßl <>
Tested-by: Georg Ringer's avatarGeorg Ringer <>
parent 1c7826d5
......@@ -26,6 +26,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\View\Event\AfterSectionMarkupGeneratedEvent;
use TYPO3\CMS\Backend\View\Event\BeforeSectionMarkupGeneratedEvent;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
......@@ -1243,11 +1244,22 @@ class PageLayoutView implements LoggerAwareInterface
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] && $this->getBackendUser()->isAdmin()) {
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->assign('error', [
'message' => str_replace(Environment::getProjectPath(), '', $e->getMessage()),
'title' => 'Error while rendering FluidTemplate preview using ' . str_replace(Environment::getProjectPath(), '', $fluidTemplateFile),
$view->setTemplateSource('<f:be.infobox title="{error.title}" state="2">{error.message}</f:be.infobox>');
return $view->render();
return null;
* Renders the preview part of a content element
* @param array $row given tt_content database record
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment