Drupal 5.15, TinyMCE 3.2.1.1
I've enabled the combination above, but when I have the Javascript aggregation patch enabled (#149402: [Drupal 5.7] Patch for JS aggregation with static file base) it causes the following error:
u is undefined
After modifying wysiwyg so it would load the tiny_mce_src.js file, it turned out the error is in 511:
// Absolute path with no host, fake host and protocol
if (u.indexOf('/') === 0 && u.indexOf('//') !== 0)
As a result it never finishes processing the aggregated js file, missing the misc/collapse.js code and more.
Using Firebug to trace through the code, the function gets executed twice, the first time with the correct arguments (u is the page location), the second time u is blank.
Searching some more, it turns out this is a bug in TinyMCE that has been reported on its bug list on SourceForge. The core bug is due to tiny_mce being loaded in a file that is not called "tiny_mce.js".
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | wysiwyg.patch | 471 bytes | k4ml |
Comments
Comment #1
k4ml commentedThis also exist in 6.x-0.5 when JS Optimization enabled under Performance settings. All the collapsible fieldsets settings does not work as in http://drupal.org/node/243662. Is there some way to exclude TinyMCE js from being aggregated ?
Comment #2
k4ml commentedI changed drupal_add_js call in wysiwyg_load_editor() function to disable the js files from being aggregated. It works now. Maybe a proper way is to add settings to enable or disable this.
Comment #3
damienmckennaI don't think WYSIWYG.module should include a patch for an active bug in one of the 3rd party libraries, but instead we should leave this patch here and hopefully TinyMCE will be fixed soon.
Comment #4
sunPlease update to the latest development snapshot. This should already be fixed there.
Comment #5
sunSee #342376: Extend API to include "preprocess" javascript switch for some editors
Comment #6
damienmckennasun: awesome, thanks for the link. This should be mentioned on the main WYSIWYG page, to avoid dupe tickets if nothing else. How stable is 5.x -dev, good enough for a production site?
Comment #7
sunYes, stable enough for a new stable release. ;) Anyway, most of the time, development snapshots of _my_ projects should be as stable as stable releases.