Bug #96516
Updated by Bastian Stargazer almost 3 years ago
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:
<pre>
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')
</pre>
As example, I had this issue with the EXT:cookieman v2.9.6 which uses the following TypoScript setup:
<pre><code>
page {
1365499 = FLUIDTEMPLATE
1365499 {
// ...
}
}
</code></pre>
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:
<pre><code class="php">
$labelValue = self::flattenTypoScriptLabelArray($labelValue, (string)$labelKey);
</code></pre>