We've created a 3rd party extension for TYPO3. After upgrading to 9.5 we now get a PHP Warning: Invalid argument supplied for foreach() in [...]/typo3_src-9.5.9/vendor/typo3fluid/fluid/src/Core/Parser/TemplateProcessor/NamespaceDetectionTemplateProcessor.php line 180
.
After some web research we found out that the problem is inline Javascript and you only can fix it by using right CDATA wrapping (more: https://forge.typo3.org/issues/88615)
So we've tried (according to the manuel https://docs.typo3.org/m/typo3/guide-extbasefluid/master/en-us/Fluid/ThingsToKnow/JsAndInline.html):
<script>
<![CDATA[
(function($){
alert('test');
})(jQuery);
]]>
</script>
But now everything between the CDATA Wrap completely disappears in the frontend return. Also if we put the script tags in between the CDATA as well.
And that also don't work:
<f:format.cdata>
<script type="text/javascript">
(function($){
alert('test');
})(jQuery);
</script>
</f:format.cdata>