Bug #85353

includeJSLibs gets overwritten by includeJSFooterlibs if same name is used

Added by Sebastian Klein over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
Start date:
2018-06-22
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There is no differentation between the two arrays includeJSLibs and includeJSFooterlibs if JavaScripts are included by using the same reference name.

If you include JavaScript files like this:

page {
    includeJSLibs {
        100 = EXT:your_ext/Resources/Public/JavaScript/javascript1.js
        javascript = EXT:your_ext/Resources/Public/JavaScript/javascript2.js
    }

    includeJSFooterlibs {
        100 = EXT:your_ext/Resources/Public/JavaScript/javascript3.js
        javascript = EXT:your_ext/Resources/Public/JavaScript/javascript4.js
    }
}

only the two JavaScripts from includeJSFooterlibs are rendered in the frontend.

I guess it's worth mentioning that this error was not reproducible with includeCSS and includeCSSLibs.

This issue was mentioned first in Slack by M. Stöckl (https://typo3.slack.com/archives/C025BQLFA/p1529333764000650) and referenced in https://forge.typo3.org/issues/85297?issue_count=66&issue_position=1&next_issue_id=85154#note-6


Related issues

Related to TYPO3 Core - Bug #85297: Breaking: TypoScript setup is overwritten Closed 2018-06-18

Associated revisions

Revision fd5c9df2 (diff)
Added by Georg Ringer over 1 year ago

[BUGFIX] Use unique keys for includeJSLibs and addJsFooterLibrary

As both TS configurations use its key the latter must use a prefix
to avoid an instant override of rendered JS file.

Resolves: #85353
Releases: master, 8.7
Change-Id: Icb685eb0ed278aafead274c1fcf86436c9e6865d
Reviewed-on: https://review.typo3.org/57349
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

Revision c78e9b42 (diff)
Added by Georg Ringer over 1 year ago

[BUGFIX] Use unique keys for includeJSLibs and addJsFooterLibrary

As both TS configurations use its key the latter must use a prefix
to avoid an instant override of rendered JS file.

Resolves: #85353
Releases: master, 8.7
Change-Id: Icb685eb0ed278aafead274c1fcf86436c9e6865d
Reviewed-on: https://review.typo3.org/57360
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

History

#1 Updated by Sebastian Klein over 1 year ago

This issue seems to only apply to the mentioned TypoScript properties for JavaScript libraries. The properties includeJS and includeJSFooter are not affected by it.

#2 Updated by Georg Ringer over 1 year ago

  • Related to Bug #85297: Breaking: TypoScript setup is overwritten added

#3 Updated by Guido Schmechel over 1 year ago

Just a short notice for the patch:

The call runs via PageGenerator->renderContentWithHeader(). The file use $pageRenderer->addJsLibrary() and $pageRenderer->addJsFooterLibrary()

Both calls jump into their PageRenderer function and set the array $this->jsLibs. If the name is te same it will be overwritten.

PageRenderer::renderAdditionalJavaScriptLibraries should check the cariavle this->jsFooterLibs, too. In a first try i could render both files.

#4 Updated by Georg Ringer over 1 year ago

  • Status changed from New to Accepted

#5 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57349

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57349

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57360

#8 Updated by Georg Ringer over 1 year ago

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

#9 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF