#96516LocalizationUtility::flattenTypoScriptLabelArray() exception if TypoScript numerous key is interpreted as integer
Description
Some numerous TypoScript keys inside the page {…} array making randomly problems. But for unclear reasons, sometime such numerous TS key is interpreted as integer by PHP, throwing the following exception:
Argument 2 passed to TYPO3\CMS\Extbase\Utility\LocalizationUtility::flattenTypoScriptLabelArray() must be of the type string, int given, called in /var/www/html/public/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php on line 244
// later in the call-stack:
at TYPO3\CMS\Extbase\Utility\LocalizationUtility::flattenTypoScriptLabelArray(
array(
'layoutRootPaths' => array('EXT:my_ext/Resources/Private/Extensions/Cookieman/Layouts/'),
'templateRootPaths' => array('EXT:my_ext/Resources/Private/Extensions/Cookieman/Templates/'),
'partialRootPaths' => array('EXT:my_ext/Resources/Private/Extensions/Cookieman/Partials/')
), 1365499) // <== here its clearly to see that the key is interpreted as interger (should be '1365499')
As example, I had this issue with the EXT:cookieman v2.9.6 which uses the following TypoScript setup:
page {
1365499 = FLUIDTEMPLATE
1365499 {
// ...
}
}
But even if I remove this extension and clearing the cache, this error will occur on other numerous keys. This happened from one day to the other in a working project. Even returning to a repository state which was 100% flawless before, the exception is thrown. Probably it has to do with a system-update or so?!
Anyway, a very easy solution is to cast the $labelKey to string:
LocalizationUtility line 244:
$labelValue = self::flattenTypoScriptLabelArray($labelValue, (string)$labelKey);Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.