From 734221294b764a64f13cfd141e955cd0733a853f Mon Sep 17 00:00:00 2001 From: Nikita Hovratov <nikita.h@live.de> Date: Mon, 15 Nov 2021 13:31:40 +0100 Subject: [PATCH] [BUGFIX] Fix PHP 8 warning in ConstantConfigurationParser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If extension authors don't provide a type for their extension configuration options, they will now fall back to "string" and prevent later undefined array key access warnings. Resolves: #95977 Releases: master Change-Id: Icd77c4d130d2fc7d0b4f127dbeb2926c4057b81c Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72175 Tested-by: core-ci <typo3@b13.com> Tested-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> --- .../Classes/TypoScript/Parser/ConstantConfigurationParser.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/typo3/sysext/core/Classes/TypoScript/Parser/ConstantConfigurationParser.php b/typo3/sysext/core/Classes/TypoScript/Parser/ConstantConfigurationParser.php index 195825a6db1b..e412b920d1e5 100644 --- a/typo3/sysext/core/Classes/TypoScript/Parser/ConstantConfigurationParser.php +++ b/typo3/sysext/core/Classes/TypoScript/Parser/ConstantConfigurationParser.php @@ -296,6 +296,8 @@ class ConstantConfigurationParser $editableComments[$const]['name'] = $const; $editableComments[$const]['value'] = trim($value); $editableComments[$const]['default_value'] = trim((string)($default[$const] ?? '')); + // If type was not provided, initialize with default value "string". + $editableComments[$const]['type'] ??= 'string'; } } return $editableComments; -- GitLab