Project

General

Profile

Actions

Bug #78206

closed

Fluid ContainerViewHelper with jQueryNamespace="none" fail

Added by Ralf Zimmermann over 7 years ago. Updated almost 7 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2016-10-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Template/DocumentTemplate.php#L630

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.
Actions #1

Updated by Björn Jacob over 7 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...

Actions #2

Updated by Benni Mack about 7 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)

Actions #3

Updated by Benni Mack almost 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.

Actions

Also available in: Atom PDF