[TASK] Log a warning if fluid-based preview template couldn't be rendered 66/58966/3
authorJosef Glatz <josefglatz@gmail.com>
Wed, 28 Nov 2018 04:41:50 +0000 (05:41 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 4 Dec 2018 04:34:45 +0000 (05:34 +0100)
A warning is logged if the fluid-based preview template for a
content element could not be rendered.

The logged warning includes
- the UID of the content element
- the resulting path to the template file
- and the exception message

Resolves: #87015
Releases: master, 8.7
Change-Id: I2cd100a5140a07845145b16259b7cbe3e5eed852
Reviewed-on: https://review.typo3.org/58966
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index be0f3b9..5402beb 100644 (file)
@@ -1790,7 +1790,16 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                         $out = $view->render();
                         $drawItem = false;
                     } catch (\Exception $e) {
-                        // Catch any exception to avoid breaking the view
+                        GeneralUtility::sysLog(
+                            sprintf(
+                                'The backend preview for content element $d can not be rendered using the Fluid template file "%s": %s',
+                                $row['uid'],
+                                $fluidTemplateFile,
+                                $e->getMessage()
+                            ),
+                            'backend',
+                            GeneralUtility::SYSLOG_SEVERITY_WARNING
+                        );
                     }
                 }
             }