Bug #78206
closedFluid ContainerViewHelper with jQueryNamespace="none" fail
0%
Description
A setup with a backend module with a Fluid Template and this configuration
<f:be.container enableClickMenu="0" loadExtJsTheme="0" loadJQuery="1" jQueryNamespace="none" >
will fail.
The expected behaviour is that a jquery script tag will be added to the html header and the "jQuery.noConflict(true)" inline javascript will not.
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/fluid/Classes/ViewHelpers/Be/ContainerViewHelper.php#L110
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Page/PageRenderer.php#L1512
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Page/PageRenderer.php#L2241
This works but the DocumentTemplate adds the jQuery tag on each backend request to.
The result is: 2 script tags and the jQuery.noConflict(true)" inline javascript
<script src="/typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery/jquery-2.2.3.js" type="text/javascript"></script> <script src="/typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery/jquery-2.2.3.js" type="text/javascript"></script> <script type="text/javascript"> /*<![CDATA[*/ var TYPO3 = TYPO3 || {}; TYPO3.jQuery = jQuery.noConflict(true); /*]]>*/ </script>
- The "loadJQuery" parameter from the ContainerViewHelper is useless because the DocumentTemplate add this every time.
- The jQueryNamespace="none" parameter does not provide the expected result.
Updated by Björn Jacob about 8 years ago
A short chat with Claus Due:
...sounds like a problem in PageRenderer, not related to the ViewHelper. There is a constant reserved for the "none" keyword so the (wrong) behavior is entirely in the PageRenderer. not sure but maybe the ModuleTemplate loadJquery can be dropped...
Updated by Benni Mack almost 8 years ago
We can remove loadjQuery option IMHO (deprecation / not doing anything with it in v8 and finally removing it in v9) now because it is loaded at every request (hopefully)
Updated by Benni Mack over 7 years ago
- Status changed from New to Rejected
This is actually not a bug, but intentionally used because TYPO3 allows to add jQuery twice in two different versions/flavors/sources. I do, however think, that this is nonsense nowadays and that's why we also always include jQuery now, and move to RequireJS modules etc.