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.
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.
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
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.
- Status changed from Resolved to Closed
Also available in: Atom
PDF