Project

General

Profile

Actions

Bug #29254

closed

Bug #22273: PageRenderer does not work for USER_INT plugins

TSFE->additionalFooterData for USER_INT

Added by Heiko Kromm about 13 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2011-08-25
Due date:
% Done:

100%

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

Description

Hi,

I think there should be the possibility to generate additionalFooterData with USER_INT extensions.
At the moment it's only possible to add additional JS from USER_INT extensions to the header.
But with the new possibility to move JS files to footer there are often missing dependencies, when including JS-files from USER_INT extensions to header.

Regards
Heiko

Actions #1

Updated by Steffen Gebert about 13 years ago

I'd say you can't add JS resources in USER_INT at all, as they are rendered after the complete page (except some markers for the USER_INT contents) has been rendered.

So I tend to set this to "Rejected", as it's not consistent with the concept of USER_INTs.

Actions #2

Updated by Björn Pedersen about 13 years ago

If remember the code right, a userint actually can generate three markers in the output stream (function INTincScript()) :
1) one in the headerpart, where js- and css-files/code can be added <!--HD_'.$this->config['INTincScript_ext']['divKey'] + INTincScript_loadJSCode();
2) the marker in the body <!--TDS_'.$this->config['INTincScript_ext']['divKey']....
3) the main marker <!--INT_SCRIPT.

So a fourth marker would be possible. But non-cached javascript should only be usedfor dynamic data as well, the non-changing code can and should be included as normal cached content for performance reason. So wether a third marker really is necessary can be discussed.

Actions #3

Updated by Heiko Kromm about 13 years ago

I think without this marker, the possibility to move JS from header to footer (config.moveJsFromHeaderToFooter) does not make much sense.
In most cases there are JavaScript-frameworks used, like Prototype or jQuery. If the framework has moved to the footer the methods of the framework (like selectors) could not be used anymore in inline JS.
With an additional marker I can put all my JS-code at the bottom of the page, which is recommended JS usage.
Without the marker the only possibility is to keep all JS in header (which slows down page loading) or use something like the scriptmerger extension to clean up JS files and put them at the bottom.

Actions #4

Updated by Björn Pedersen about 13 years ago

Well, for normal cached javascript, there is no problem here. And I my opinion a user_int plugin should only it's changing daat assigned to some var as non-cached javascript. Then, the tiny amount of JS used should not hurt. If larger amounts of data are needed, eID+ json are better anyway. But I would not object a fourth marker if somebody creates a patch.

Actions #5

Updated by Oliver Hader over 12 years ago

I consider this as a bug, the TSFE->additionalFooterData has been introduced with 4.3 however only for the t3lib_pageRenderer - so we have something like that already.

The problem with USER_INTs is, that e.g. if jQuery was told to be loaded in the footer, you don't have any chance to make use of jQuery in a USER_INT script (e.g. for widgets or something like that). Thus, using the available additionalFooterData seems to be okay - however a lot of stuff is missing there:

$ git blame typo3/sysext/cms/tslib/class.tslib_pagegen.php | grep additionalFooterData
6bea4ac3 (Steffen Kamper     2009-09-06 21:32:48 +0000 1028)         if ($GLOBALS['TSFE']->additionalFooterData) {
30c60eef (Benni Mack         2010-04-12 16:17:20 +0000 1029)             $pageRenderer->addFooterData(implode(LF, $GLOBALS['TSFE']->additionalFooterData));
Actions #6

Updated by Oliver Hader over 12 years ago

  • Status changed from New to Accepted
  • Assignee set to Oliver Hader
Actions #7

Updated by Oliver Hader over 12 years ago

  • Tracker changed from Feature to Bug
Actions #8

Updated by Oliver Hader over 12 years ago

  • Subject changed from additionalFooterData for USER_INT to TSFE->additionalFooterData for USER_INT
Actions #9

Updated by Gerrit Code Review over 12 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11859

Actions #10

Updated by Gerrit Code Review over 12 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/11860

Actions #11

Updated by Helmut Hummel over 12 years ago

  • Parent task set to #22273
Actions #12

Updated by Gerrit Code Review over 12 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11859

Actions #13

Updated by Gerrit Code Review over 12 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11859

Actions #14

Updated by Gerrit Code Review over 12 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11859

Actions #15

Updated by Gerrit Code Review over 12 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11859

Actions #16

Updated by Oliver Hader over 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #17

Updated by Gerrit Code Review over 12 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/11860

Actions #18

Updated by Oliver Hader over 12 years ago

  • Status changed from Under Review to Resolved
Actions #19

Updated by Gerrit Code Review over 12 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/12570

Actions #20

Updated by Gerrit Code Review over 12 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/12571

Actions #21

Updated by Oliver Hader over 12 years ago

  • Status changed from Under Review to Resolved
Actions #22

Updated by Gerrit Code Review over 12 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/13179

Actions #23

Updated by Gerrit Code Review over 12 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/13289

Actions #24

Updated by Alexander Opitz over 11 years ago

  • Status changed from Under Review to Resolved

It seams this issue was resolved. The two gerrit code reviews are removed (maybe they had false issue number).

Actions #25

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF