Issue Bug Closed

#60213pageRenderer->addJsFooterFile doesn't work as expected

Bernhard Kraft 07/09/14, 18:40 updated 08/04/20, 09:59

Description

When using “addJsFooterFile” to add JS files to a backend module this doesn’t work as expected.
The reason for this is located in backend/Classes/Template/DocumentTemplate.php @ line 910 and 914
(https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/backend/Classes/Template/DocumentTemplate.php#l910)

The pageRenderer method “render” is called twice. Once for rendering the header and a second time for rendering the footer. But inside the render method the internal “jsFiles” and all other variables get reset:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/core/Classes/Page/PageRenderer.php#l1943

It is stated, that the pageRenderer needs a full reset after each rendering – but it is not stated why this full reset is needed.

I created a patch which disables the reset via an argument to ->render method. This did not show any side effects for a few short tests.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.