From d24434ed828a4973c99a2e703fc6a9157f45e1ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech>
Date: Tue, 7 Feb 2023 19:13:18 +0100
Subject: [PATCH] [BUGFIX] Avoid undefined array key "templateName" in
 FormEditorController

Use null coalescing operator to guard against
undefined array key "templateName" accesss in
`\TYPO3\CMS\Form\Controller\FormEditorController`.

Resolves: #99870
Releases: main, 11.5
Change-Id: I3ebc40e6caab8c2f5bb32563848e836171c44f7b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77785
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/form/Classes/Controller/FormEditorController.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/form/Classes/Controller/FormEditorController.php b/typo3/sysext/form/Classes/Controller/FormEditorController.php
index 40f70cb592d6..4f3573375095 100644
--- a/typo3/sysext/form/Classes/Controller/FormEditorController.php
+++ b/typo3/sysext/form/Classes/Controller/FormEditorController.php
@@ -533,7 +533,7 @@ class FormEditorController extends AbstractBackendController
                 continue;
             }
             foreach ($configuration['formEditor']['editors'] as $editorConfiguration) {
-                if ($editorConfiguration['templateName'] === 'Inspector-PropertyGridEditor') {
+                if (($editorConfiguration['templateName'] ?? '') === 'Inspector-PropertyGridEditor') {
                     $multiValueFormElementProperties[$type][] = $editorConfiguration['propertyPath'];
                 }
             }
@@ -545,7 +545,7 @@ class FormEditorController extends AbstractBackendController
             }
 
             foreach ($configuration['editors'] as $editorConfiguration) {
-                if ($editorConfiguration['templateName'] === 'Inspector-PropertyGridEditor') {
+                if (($editorConfiguration['templateName'] ?? '') === 'Inspector-PropertyGridEditor') {
                     $multiValueFinisherProperties[$configuration['identifier']][] = $editorConfiguration['propertyPath'];
                 }
             }
-- 
GitLab