When optimizing Javascript Files, Drupal catches them and put them together to a single file.
In some cases the javascripts are not working anymore after activating this performance based setting. In my case the error was that at the end of one js file there was a line based comment (starts with //) so that the file after this one was put directly behind the line basend comment. the result was that the first line of the next js was commented out and this causes an error so js breakes down.
To avoid this one can easily add a new line behind the ";" drupal_build_js_cache already adds at the end of each optimized javascript.
I would like to see that in one of the next versions because now I have to edit every modules js file and add a new line per hand.
Comment | File | Size | Author |
---|---|---|---|
#1 | common.inc.patch | 472 bytes | ambo |
Comments
Comment #1
ambo CreditAttribution: ambo commentedSo as if nobody seems to find this one interesting, I decided to create a pathc for that. The attatched file fixes this issue by adding the newline to each aggregated javascript.
Comment #2
ambo CreditAttribution: ambo commentedComment #3
jweowu CreditAttribution: jweowu commentedTested.
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis needs to be fixed in D7 first.
Comment #5
casey CreditAttribution: casey commentedFixed in both D7 and D6.