Skip to content

Commit

Permalink
[BUGFIX] Catch TS generation error in logging service
Browse files Browse the repository at this point in the history
When a blog post can't be found, the extension will add a log entry
for this incident. The logging service will try to get TS
configuration which will fail in some circumstances like missing blog
post slug (e.g. /blog/article/2000/12/30/). Following error is thrown:

Uncaught TYPO3 Exception: Call to a member function getSetupArray() on null
Error thrown in file vendor/typo3/cms-extbase/Classes/Configuration/FrontendConfigurationManager.php in line 202
  • Loading branch information
fnagel committed Dec 5, 2023
1 parent 0e38ef5 commit 4e39899
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Service/LoggingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public function __construct(protected SettingsService $settingsService)

public function initializeObject()
{
$this->renderInFe = (bool)$this->settingsService->getTypoScriptByPath('debug.renderInFe');
try {
$this->renderInFe = (bool)$this->settingsService->getTypoScriptByPath('debug.renderInFe');
} catch (\Throwable) {
}
}

public function error($msg, array $data = [])
Expand Down

0 comments on commit 4e39899

Please sign in to comment.