Skip to content
Snippets Groups Projects
Commit 82750ddb authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Prevent RegisterService from crashing if no mail template have been registered

parent 616160b0
No related branches found
Tags 9.0.5
No related merge requests found
...@@ -95,21 +95,23 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { ...@@ -95,21 +95,23 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface {
private function registerExtensions(): array { private function registerExtensions(): array {
$this->registerArray = []; $this->registerArray = [];
foreach ($GLOBALS['sg_mail'] as $extensionName => $templates) { if (\is_array($GLOBALS['sg_mail'])) {
foreach ($templates as $templateKey => $registerFile) { foreach ($GLOBALS['sg_mail'] as $extensionName => $templates) {
$registerFile = GeneralUtility::getFileAbsFileName($registerFile); foreach ($templates as $templateKey => $registerFile) {
if (!\is_file($registerFile)) { $registerFile = GeneralUtility::getFileAbsFileName($registerFile);
continue; if (!\is_file($registerFile)) {
} continue;
}
$configArray = (include $registerFile);
$extensionKey = $configArray['extension_key']; $configArray = (include $registerFile);
$templateKey = $configArray['template_key']; $extensionKey = $configArray['extension_key'];
if ($extensionKey === NULL) { $templateKey = $configArray['template_key'];
continue; if ($extensionKey === NULL) {
continue;
}
$this->writeRegisterArrayEntry($extensionKey, $templateKey, $configArray);
} }
$this->writeRegisterArrayEntry($extensionKey, $templateKey, $configArray);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment