[TASK] Log a warning if fluid-based preview template couldn't be rendered 60/58960/6
authorJosef Glatz <josefglatz@gmail.com>
Tue, 27 Nov 2018 12:24:32 +0000 (13:24 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 27 Nov 2018 14:49:18 +0000 (15:49 +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/58960
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Alexander Grein <alexander.grein@gmail.com>
Tested-by: Alexander Grein <alexander.grein@gmail.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 e806452..88fb440 100644 (file)
@@ -2204,7 +2204,12 @@ class PageLayoutView implements LoggerAwareInterface
                         $out = $view->render();
                         $drawItem = false;
                     } catch (\Exception $e) {
-                        // Catch any exception to avoid breaking the view
+                        $this->logger->warning(sprintf(
+                            'The backend preview for content element %d can not be rendered using the Fluid template file "%s": %s',
+                            $row['uid'],
+                            $fluidTemplateFile,
+                            $e->getMessage()
+                        ));
                     }
                 }
             }