Skip to content

Commit 2a8a884

Browse files
committed
[BUGFIX] Catch undefined array key error in PHP 8
Related: #786
1 parent 70d77a2 commit 2a8a884

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Classes/Domain/Model/Field.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,12 @@ protected function extendTypeArrayWithTypoScriptTypes(array $types): array
782782
$typoScript = BackendUtility::getPagesTSconfig(FrontendUtility::getCurrentPageIdentifier());
783783
if (!empty($typoScript['tx_powermail.']['flexForm.'])) {
784784
$configuration = $typoScript['tx_powermail.']['flexForm.'];
785-
foreach ((array)$configuration['type.']['addFieldOptions.'] as $fieldTypeName => $fieldType) {
786-
if (!empty($fieldType['dataType'])) {
787-
$fieldTypeName = substr($fieldTypeName, 0, -1);
788-
$types[$fieldTypeName] = (int)$fieldType['dataType'];
785+
if (isset($configuration['type.']['addFieldOptions.'])) {
786+
foreach ((array)$configuration['type.']['addFieldOptions.'] as $fieldTypeName => $fieldType) {
787+
if (!empty($fieldType['dataType'])) {
788+
$fieldTypeName = substr($fieldTypeName, 0, -1);
789+
$types[$fieldTypeName] = (int)$fieldType['dataType'];
790+
}
789791
}
790792
}
791793
}

0 commit comments

Comments
 (0)