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.

CommentFileSizeAuthor
#1 common.inc.patch472 bytesambo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ambo’s picture

Status: Active » Needs review
FileSize
472 bytes

So 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.

ambo’s picture

Version: 6.12 » 6.14
jweowu’s picture

Status: Needs review » Reviewed & tested by the community

Tested.

Damien Tournoud’s picture

Version: 6.14 » 7.x-dev
Status: Reviewed & tested by the community » Active

This needs to be fixed in D7 first.

casey’s picture

Status: Active » Fixed

Fixed in both D7 and D6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.