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

CommentFileSizeAuthor
#2 wysiwyg.patch471 bytesk4ml

Comments

k4ml’s picture

This 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 ?

k4ml’s picture

StatusFileSize
new471 bytes

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

else {
        // Fallback to the first by default (external libraries can change).
        $library = key($editor['libraries']);
        $files = array_shift($editor['libraries']);
        $files = $files['files'];
      }
      foreach ($files as $file) {
        drupal_add_js($editor['library path'] . '/' . $file, 'module', 'header', False, True, False);
      }
      // Load JavaScript integration files for this editor.
      $files = array();
damienmckenna’s picture

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

sun’s picture

Status: Active » Fixed

Please update to the latest development snapshot. This should already be fixed there.

sun’s picture

damienmckenna’s picture

sun: 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?

sun’s picture

Yes, stable enough for a new stable release. ;) Anyway, most of the time, development snapshots of _my_ projects should be as stable as stable releases.

Status: Fixed » Closed (fixed)

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