Project

General

Profile

Actions

Bug #91653

closed

PageRenderer addJsLibrary and addJsFooterLibrary add the same file multiple times

Added by Markus Klein over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Target version:
-
Start date:
2020-06-16
Due date:
% Done:

100%

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

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.

Actions #1

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

Actions #2

Updated by Markus Klein over 4 years ago

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

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.

Actions #4

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF