Drupal 5.5

JavaScript Aggregation disabled:
- no javascript errors, TinyMCE working, collapsible fieldsets working

JavaScript Aggregation enabled:
- "missing ; before statement" error in the aggregated file, followed by "Drupal is not defined", etc.
- the first JS error comes from the /misc/jquery.js file (the same problem when using the official jQuery 1.2.2 uncompressed or packed jquery.js file, or when using the 1.1.2 version included in the jquery_update module)
- symptoms: TinyMCE and collapsible fieldsets not working anymore
- even if I get the line/column number for this error, I'm not able to precisely identify the exact place in the jquery.js code where the problem is occurring.

Any idea? Can you try to reproduce?

Thanks

CommentFileSizeAuthor
#9 javascript_aggregator.module.patch594 bytesderjochenmeyer

Comments

derjochenmeyer’s picture

Status: Postponed (maintainer needs more info) » Active

Hi ardelio, please use the official 0.5 release. dev is old code (packaging script only runs every 12h). Im new to CVS so maybe i could do something about it. If you get any errors with 0.5 please report back.

derjochenmeyer’s picture

Status: Active » Postponed (maintainer needs more info)
wim leers’s picture

Category: support » bug
Priority: Normal » Critical

This is normal. This is exactly why it's no longer included in Drupal 6 core. The packer is *not* reliable. It leaves you with countless JS errors. You'll have to use another compressor if you want reliable results.

I encourage to check the new D7 JS compression issue: http://drupal.org/node/210447.

derjochenmeyer’s picture

Hi Wim, the files are not compressed by this module, only the comments are removed via a regular expression optionally.

Do you see any way i could optimize this module? Comments appreciated :)

derjochenmeyer’s picture

Assigned: Unassigned » derjochenmeyer

The version to which this issue refers is 5.x-0.x-dev... The dev version is not recommended. Please check if the errors are also present with 5.x-0.5 (make also sure you do a hard browser reload since .js file may be cached locally)

derjochenmeyer’s picture

Status: Active » Postponed (maintainer needs more info)
wim leers’s picture

Oops! Sorry. I saw "aggregator" and read "compressor". My mistake :)

ardelio’s picture

Version: 5.x-0.x-dev » 5.x-0.5
Status: Postponed (maintainer needs more info) » Active

@derjochenmeyer – I confirm the same behavior with 5.x-0.5 version. No JavaScript error when the page includes /misc/jquery.js and other separate JS calls (without aggregation). The “missing ; before statement” error in the jquery.js section of the aggregated file as soon as I enable JavaScript aggregation + other symptoms mentioned above.

Any idea? Can you try to reproduce?

--
@derjochenmeyer, @Wim Leers
FYI, I disabled new options "Aggregate JavaScript files" and "Optimize JavaScript Files" in the "Javascript Aggregation" section, and enabled the old patch "Optimize JavaScript files" in the "Bandwidth optimizations" section. The aggregation and minification worked better this time (collapsed fields working), but TinyMCE still has a problem (error "TinyMCE.baseURL has no properties"). It seems that the aggregation order is important for TinyMCE. This error has already been discussed in #31 at http://drupal.org/node/119441, but I haven’t seen any solution. No other apparent errors (tests included large number of modules using IE7/FF for the moment).

In summary (in our case):
- no collapsible fieldsets nor TinyMCE when using the Javascript Aggregator module
- collapsed fieldsets now ok when using the "standard" Optimize JavaScript files option, but TinyMCE still not ok.

=> We’re happy to finally have JS aggregation and minification working with the initial js-aggregation-149402-16.patch even if we can’t use TinyMCE for the moment.

Thanks

derjochenmeyer’s picture

StatusFileSize
new594 bytes

strange, i have js aggregator running on a site with a lot of js extensive modules including chatblock, FCKeditor, Javascript Tools no errors... are you sure you cleared your local browser AND server cache.. try also the appended patch... it adds a semicolon after each .js file...

The aggregation and minification worked better this time

you mean with the old patch... the JS Aggregator module only removes comments if enabled, so the minification is minor in any case...

this is the list of modules in my testinstallation... :

Drupal Administration Menu 5.x-2.2
Audio 5.x-1.3
Auto locale import 5.x-1.x-dev (2007-Okt-14)
Calendar 5.x-1.7
CAPTCHA 5.x-3.1
Content Construction Kit (CCK) 5.x-1.6-1
CCK Field Permissions 5.x-1.10
Chatblock 5.x-1.0.x-dev (2007-Nov-21)
Content Templates (Contemplate) 5.x-1.8
Date 5.x-1.8
Double Click 5.x-1.0
Devel 5.x-1.x-dev (2008-Jan-11)
External Links 5.x-1.3
FCKeditor - WYSIWYG HTML editor 5.x-2.0-beta
Fivestar 5.x-1.10
Google Analytics 5.x-1.3
Internationalization 5.x-2.2
Image 5.x-2.x-dev (2008-Jan-10)
ImageCache 5.x-1.3
ImageField 5.x-1.1
IMCE 5.x-1.0
Javascript Aggregator 5.x-0.5
JQuery Update 5.x-1.0
Javascript Tools 5.x-0.8
Link 5.x-2.1
Poormanscron 5.x-1.1
Simplenews 5.x-1.2
Smileys 5.x-1.2-beta
Tagadelic 5.x-1.0-rc1
Thickbox 5.x-1.1
Update status 5.x-2.0
Video 5.x-1.x-dev (2007-Jun-23)
Views 5.x-1.6
Views Bonus Pack 5.x-1.2-alpha1
Voting API 5.x-1.5
Webform 5.x-1.7

derjochenmeyer’s picture

i also tested nicEdit WYSIWIG Editor 5.x-1.x-dev and get no errors

didnt test it with TinyMCE yet

chirale’s picture

I confirm the error using TinyMCE, with or without applying the latest patch on two different websites. Other modules (like fivestar and JCarousel) haven't any problem, and elements like collapsible blocks works fine.

Any idea?

derjochenmeyer’s picture

thansk for confirming, i'll try to figure out whats different with TinyMCE ...

has anybody firebug installed and check what errors it gives?

derjochenmeyer’s picture

Title: jQuery Errors » jQuery Errors when using TinyMCE
Status: Active » Postponed (maintainer needs more info)
derjochenmeyer’s picture

i tested with TinyMCE and can confirm the bug.

the inclusion of /sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js causes the errors

an option for this module would be, to add a texterea to the admin/settings/performance section where you can list files to be excluded from the aggregation.

but there is a problem: excluding files this way could change the order the files are included. which causes errors if you exclude /misc/jquery.js just as a prominent example.

because all that stuff gets aggregated except for /misc/jquery.js

<script type="text/javascript" src="/misc/jquery.js"></script>
<script type="text/javascript" src="/misc/drupal.js"></script>
<script type="text/javascript" src="/sites/all/modules/admin_menu/admin_menu.js"></script>
<script type="text/javascript" src="/sites/all/modules/jquery_update/compat-1.0.js"></script>
<script type="text/javascript" src="/sites/all/modules/devel/devel.js"></script>
<script type="text/javascript" src="/sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/misc/collapse.js"></script>
<script type="text/javascript" src="/sites/all/modules/jquery_update/collapse-fix.js"></script>

making it this

<script type="text/javascript" src="/files/js/c3dbcc6d0c9284d14a3f189671611155.js"></script>
<script type="text/javascript" src="/misc/jquery.js"></script>

now jquery.js is included after all the rest. its tricky and maybe not worth the effort ...

another option is to explicitly exclude TinyMCE

chirale’s picture

On aggregated file (patched js aggregator), Firebug breaks on:

1446: if (Drupal.jsEnabled) {
1447:  $(document).ready(Drupal.ogAttach);
1448: }
1449: ;
1450: function TinyMCE_Engine(){var ua;this.majorVersion="2";this.minorVersion="1.1.1";this.releaseDate="2007-05-14";this.ins [...]} if(l<1000)tinyMCE.log[l]="[debug] "+m}});
;
ardelio’s picture

Status: Postponed (maintainer needs more info) » Active

status update

derjochenmeyer’s picture

also reading through discussions about the JS aggregation in Drupal 6 it seems that its hard to fix this issue. For now im not working on fixing this issue. Im considering a workaround instead.

Please makes comments on this issue here (http://drupal.org/node/216315)

derjochenmeyer’s picture

derjochenmeyer’s picture

Status: Active » Fixed

please use new version. Added a configurable discard list.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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