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

CommentFileSizeAuthor
#22 tinymce_js_agg.patch841 bytesbhuga

Comments

giorgosk’s picture

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

Diseree’s picture

I have same experience.

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

yhager’s picture

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

tcaduto’s picture

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.

yhager’s picture

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.

elkanaut’s picture

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.

luti’s picture

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?

keva’s picture

subscribing

angsikod’s picture

subscribing

Steve Dougherty’s picture

Subscribing

pulsar’s picture

subscribing

jbergeron’s picture

subscribing

jesepi’s picture

subscribing

RobR’s picture

subscribing

ianchan’s picture

subscribing

katbailey’s picture

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

pieter333’s picture

subscribing

mikebuck’s picture

Subscribing

loze’s picture

Subscribing

gsivorot’s picture

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.

greenskunk’s picture

+1 Thank you gsivorot.

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

bhuga’s picture

Status: Active » Needs review
StatusFileSize
new841 bytes

Unfortunately, there's no 'proper' way to fix this, as Drupal js aggregation puts aggregated js before all other js, which is unfortunate if you need to populate a variable before aggregated stuff is run, as is the case here.

This patch uses drupal_set_html_head to set variables for TinyMCE's .NET aggregation check. Works for me. You might need to edit the 'suffix' one; I have my web server doing compression and don't use that other stuff.

tlogan’s picture

subscribing

janusman’s picture

subscribing

giorgosk’s picture

patch from #22 seems to work

This incompatibility prevented other javascript components from working
when JS optimization was turned on

bhuga’s picture

GiorgosK,

Can you be more specific about what stopped working, and in what circumstances? Do you mean that the patch in #22 broke another module, and if so, which?

giorgosk’s picture

No @bhuga I just said that the patch works !! (at least for me)
but maybe I was not clear enough

The rest was a more general comment and a warning if people DON'T actually use this patch, which might be rephrased as follows

tinyMCE not being JS optimizable (subject of this issue) causes other modules to stop working when JS optimization is turned on !! (does it make sense ?)

cloxzime’s picture

I have replaced the code below in tinymce.admin.inc. The good news, the error is not appear anymore BUT the editor still NOT appear in Content > Page/Story textbox.

'#default_value' => isset($edit->rids) ? array_keys((array) $edit->rids) : array(),

The next thing that blocked my abillity is, I am using Shared Hosting with cPanel. So that I have no privilege to use such command to install the patches as I am NOT able to access root server.

Could you please show me the right way.

Your help are greatly appreciated.

Thanks & regards,
cloxzime

bhuga’s picture

Status: Needs review » Reviewed & tested by the community

Updating status based on Giorgosk's comments and no complaints on a thread with so many subs. Thanks for the clarification.

@cloxzime,

I don't think the change you've made is correct. You should probably revert that change and apply the patch.

You can patch files under cpanel directly if your host allows ssh. If they don't, you can still ftp your site down, apply the patch, and put it back up. You don't need any special access to patch the module; it should all be in your public_html folder.

If you can SSH, see http://drupal.org/patch/apply, which refers to core but works for modules just as well. Exact instructions will differ based on your OS if you need to use ftp, but google will have those instructions for you.

eriktoyra’s picture

Have you tried with disabling page compression and clearing the cache in the Performance settings [admin/settings/performance]? That did the trick for me when I had the same problem with a similiar setup.

nicoloye’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)