Bug #91653
closedPageRenderer addJsLibrary and addJsFooterLibrary add the same file multiple times
100%
Description
These two functions contain an invalid (always true) condition before adding the JS to the internal file array.
All other similar functions already hold a correct condition.
I suggest making those API function behave identical - as the current code would suggest already.
Updated by Gerrit Code Review over 4 years ago
- Status changed from New 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/c/Packages/TYPO3.CMS/+/64897
Updated by Markus Klein over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f1796a9f092d8c1498901dddaeb998f1b46527ba.
Updated by Jonas Eberle over 4 years ago
Actually the current code did not always add a new entry, but would overwrite an existing entry with the same `name` if it existed already. It would only add new entries if the `name` changed.
So although the condition had a logical error and was always true, it behaved correctly and as expected because it allowed to overwrite an already registered asset. This btw. is the behaviour, that the AssetCollector uses, too.
In my opinion there was no bug here.
I still suggest as in my comment in the review to rather remove the condition completely. I might have been hard to understand but I firmly believe that this would be the only non-breaking way.