0
votes

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>
2

2 Answers

0
votes

Try either:

<script type="text/javascript">
   <f:format.cdata>
      (function($){
        alert('test');
      })(jQuery);
   </f:format.cdata>
</script>

or

<f:format.raw>
   <script type="text/javascript">
      (function($){
        alert('test');
      })(jQuery);
   </script>
</f:format.raw>
0
votes

Update to TYPO3 CMS 9.5.10 LTS fixed all the problems we have.