Skip to content

Commit

Permalink
[FIX] Improve BE module controller error rendering
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fnagel committed Dec 30, 2024
1 parent 994b5aa commit f7c69b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Classes/Controller/AbstractBackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit f7c69b5

Please sign in to comment.