From f7c69b51a37092e62997898ac6f11d57c61468f8 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 30 Dec 2024 11:25:13 +0100 Subject: [PATCH] [FIX] Improve BE module controller error rendering Improve error rendering when BE module controller are used outside of the related pages scope. Without this change, using one of the post, comment or subscriber controller actions will result in a non catched exception. --- Classes/Controller/AbstractBackendController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Controller/AbstractBackendController.php b/Classes/Controller/AbstractBackendController.php index 07ce9bb5..f4888d96 100644 --- a/Classes/Controller/AbstractBackendController.php +++ b/Classes/Controller/AbstractBackendController.php @@ -10,6 +10,7 @@ */ use FelixNagel\T3extblog\Utility\SiteConfigurationValidator; +use TYPO3\CMS\Backend\Routing\RouteResult; use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; use FelixNagel\T3extblog\Domain\Repository\BlogSubscriberRepository; @@ -210,7 +211,10 @@ protected function initializeAction(): void } catch (InvalidConfigurationException $exception) { // On pages with blog records we need to make sure we have a valid configuration so escalate! - if ($this->pageInfo['show'] === false) { + if ($this->pageInfo['show'] === false || ( + ($routing = $this->request->getAttribute('routing')) instanceof RouteResult && + $routing->getRoute()->getOption('controller') !== 'BackendDashboard' + )) { $this->getLog()->exception($exception, [ 'pid' => $this->pageId, 'context' => 'backend',