tinyMCE is incompatible with core JS optimization

GiorgosK - April 7, 2008 - 16:30
Project:TinyMCE WYSIWYG Editor
Version:6.x-1.1-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

after installing
6.x-1.1-dev module
and tinyMCE 3.0.6.1 in
sites/all/modules/tinymce/
so the actual path to javascript files is
\sites\all\modules\tinymce\tinymce\jscripts\tiny_mce\tiny_mce.js

admin/settings/tinymce/add
configuring profile displays

warning: Invalid argument supplied for foreach() in I:\drupal\includes\form.inc on line 1181.

on profile:
default state: enabled

assigning tinymce permissions

trying to create story gives following error on firebug

tinyMCE is not defined
[Break on this error] tinyMCE.init({

same thing happens with 1.x-dev version
and with tinymce 2.1.3 version

#1

GiorgosK - April 7, 2008 - 17:14

for tinyMCE 6.x-1.1-dev the javascript errors are 2

tinyMCE has no properties
[Break on this error] tinyMCE.init({

u has no properties
[Break on this error] tinyMCE.init({

both indicating the same line

also the collapsible fieldsets are not working
but when disabling tinyMCE they work again

possibly there is a confict with
collapsible fieldsets and tinyMCE javascript code ???

I also forgot to mention that this happens in
a clean firefox 2.0.0.13, IE6, IE7
on localhost with XAMPP 1.6.3a

#2

Diseree - April 9, 2008 - 05:59

I have same experience.

Disable 'Optimize JavaScript files' checkbox in performance section.
Then tinyMCE may be work.

#3

yhager - April 9, 2008 - 15:40

The workaround in comment #2 works for me as well.
But I wish it worked with JS compression enabled.
Subscribing.

#4

tcaduto - April 11, 2008 - 22:03

I had this problem as well, and turned off the JS optimization, but now am getting other JS errors:

tinyMCE.importThemeLanguagePack is not a function
http://www.amsoftwaredesign.com/modules/tinymce/tinymce/jscripts/tiny_mc...
Line 1

o is not a constructor
http://www.amsoftwaredesign.com/modules/tinymce/tinymce/jscripts/tiny_mc...
Line 1

Anyone see this?

Drupal 6.2 with the current TinyMCE module and TinyMCE 3.x (stable)

the exact same setup works on a different 6.2 install that was not update, but installed fresh.

#5

yhager - April 12, 2008 - 07:18
Title:tinyMCE does not display, creates javascript error» tinyMCE is incompatible with core JS optimization
Component:User interface» Code

I hope it is ok that I change the subject, but it seems like this becomes a mix of a few issues.
Lets use this issue to keep track of usage of tinyMCE with "JS optimization" option enabled under 'admin/settings/performance'.

I have tested with or without the TinyMCE compressor, and the result is the same.

#6

elkanaut - April 24, 2008 - 11:54

I have the same problem, this two errors happens when JS optimization enabled:

tinyMCE has no properties
[Break on this error] tinyMCE.init({

u has no properties
[Break on this error] tinyMCE.init({

Also the collapsible fieldsets are not working. As I see Drupal 5 plugin has the same problem, and it happens with all versions of TinyMCE editor.

As soon as you turn off JS optimization everything works fine.

#7

LUTi - April 25, 2008 - 10:21

I have JS Optimization turned off since I've installed Drupal 6.2, but still, as soon as I install TinyMCE module, I loose:
- splitted window for teaser and a body in node edit form (which otherwise works well)
- collapsable fields (which otherwise work well too)
- maybe something else I haven't noticed yet...

I've tried to turn JS Optimization on (when it is on, there is no TinyMCE, but normal text window only) and back off, without any success.

I also don't have a "switch to normal mode" (disable/enable toggle) option, even if I've enabled it in profiles.

I've also noticed there are buttons (images) in TinyMCE profile specification screen in 5.x, but only texts in 6.x... Is this by design, or due to the fact that something is broken?

#8

Zelavi - May 18, 2008 - 20:01

subscribing

#9

angsikod - May 19, 2008 - 14:01

subscribing

#10

Steve Dougherty - May 19, 2008 - 18:45

Subscribing

#11

pulsar - May 27, 2008 - 13:47

subscribing

#12

jbergeron - May 28, 2008 - 14:21

subscribing

#13

jesepi - June 3, 2008 - 14:51

subscribing

#14

RobR - June 4, 2008 - 02:52

subscribing

#15

ianchan - June 12, 2008 - 21:59

subscribing

#16

katbailey - June 15, 2008 - 06:33

Regarding the disable/enable toggle link, see the separate issue (and patch) here: http://drupal.org/node/262231#comment-882684

#17

pieter333 - June 21, 2008 - 16:10

subscribing

#18

mikebuck - June 21, 2008 - 22:38

Subscribing

#19

loze - July 21, 2008 - 01:48

Subscribing

#20

gsivorot - September 3, 2008 - 23:23

Temporary fix:

Turn off preprocessing for the tiny_mce js file in the Tiny MCE module:

Change this...
drupal_add_js($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/tiny_mce.js');

To this...
drupal_add_js($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/tiny_mce.js', 'module', 'header', FALSE, TRUE, FALSE);

At least the other js files will be optimized.

#21

GreenSkunk - October 2, 2008 - 15:52

+1 Thank you gsivorot.

Thanks for looking at the API api.drupal.org!!!

 
 

Drupal is a registered trademark of Dries Buytaert.