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
No related tags found
No related merge requests found
......@@ -95,21 +95,23 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface {
private function registerExtensions(): array {
$this->registerArray = [];
foreach ($GLOBALS['sg_mail'] as $extensionName => $templates) {
foreach ($templates as $templateKey => $registerFile) {
$registerFile = GeneralUtility::getFileAbsFileName($registerFile);
if (!\is_file($registerFile)) {
continue;
}
$configArray = (include $registerFile);
$extensionKey = $configArray['extension_key'];
$templateKey = $configArray['template_key'];
if ($extensionKey === NULL) {
continue;
if (\is_array($GLOBALS['sg_mail'])) {
foreach ($GLOBALS['sg_mail'] as $extensionName => $templates) {
foreach ($templates as $templateKey => $registerFile) {
$registerFile = GeneralUtility::getFileAbsFileName($registerFile);
if (!\is_file($registerFile)) {
continue;
}
$configArray = (include $registerFile);
$extensionKey = $configArray['extension_key'];
$templateKey = $configArray['template_key'];
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