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
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | javascript_aggregator.module.patch | 594 bytes | derjochenmeyer |
Comments
Comment #1
derjochenmeyer commentedHi 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.
Comment #2
derjochenmeyer commentedComment #3
wim leersThis 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.
Comment #4
derjochenmeyer commentedHi 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 :)
Comment #5
derjochenmeyer commentedThe 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)
Comment #6
derjochenmeyer commentedComment #7
wim leersOops! Sorry. I saw "aggregator" and read "compressor". My mistake :)
Comment #8
ardelio commented@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
Comment #9
derjochenmeyer commentedstrange, 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...
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
Comment #10
derjochenmeyer commentedi also tested nicEdit WYSIWIG Editor 5.x-1.x-dev and get no errors
didnt test it with TinyMCE yet
Comment #11
chirale commentedI 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?
Comment #12
derjochenmeyer commentedthansk for confirming, i'll try to figure out whats different with TinyMCE ...
has anybody firebug installed and check what errors it gives?
Comment #13
derjochenmeyer commentedComment #14
derjochenmeyer commentedi 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
making it this
now jquery.js is included after all the rest. its tricky and maybe not worth the effort ...
another option is to explicitly exclude TinyMCE
Comment #15
chirale commentedOn aggregated file (patched js aggregator), Firebug breaks on:
Comment #16
ardelio commentedstatus update
Comment #17
derjochenmeyer commentedalso 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)
Comment #18
derjochenmeyer commentedComment #19
derjochenmeyer commentedplease use new version. Added a configurable discard list.
Comment #20
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.