2008-Dec-28 6.x-3.x-dev

Whenever I go to comment, eg., site.com/comment/reply/x#comment-form -- I get the following javascript error in Internet Explorer (but not Firefox):

[code]Line 2
Char 1
Error: 'tinyMCE is undefined'
Code: 0
URL: http://www.site.com/comment/reply/xy/x[/code]

Nothing shows up on the page... but if I try to view the source I get:

So the above code is what is causing the error -- but only in IE 6 and IE 7 for some reason.

CommentFileSizeAuthor
#25 img_assist-DRUPAL-5--2.basePath.patch1.05 KBsun
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ryanbach’s picture

<script type="text/javascript" src="/sites/all/modules/img_assist/drupalimage/langs/en.js?M"></script>

Ryanbach’s picture

2008-Dec-28 6.x-3.x-dev

Whenever I go to comment, eg., site.com/comment/reply/x#comment-form -- I get the following javascript error in Internet Explorer (but not Firefox):

Line 2
Char 1
Error: 'tinyMCE is undefined'
Code: 0
URL: http://www.site.com/comment/reply/xy/x

Nothing shows up on the page... but if I try to view the source I get: <script type="text/javascript" src="/sites/all/modules/img_assist/drupalimage/langs/en.js?M"></script>

So the above code is what is causing the error -- but only in IE 6 and IE 7 for some reason.

Eric_A’s picture

As a workaround disabling the image assist icon (Textarea image link: Do not show a link) worked for me. (Wysiwyg API 6.x-0.5, Image Assist 6.x-2.x-dev, TinyMCE 3.2.1.1).

EDIT: this issue occurred when both the TinyMCE Image Assist plugin and the Image Assist Icon were activated. Disabling the plugin is another workaround :-)

Perhaps related to #204702: JavaScript errors due to global function name clashes
http://drupal.org/node/204702#comment-681311

travismiller’s picture

This seems to be the breaking point:

img_assist/drupalimage/editor_plugin.js:6

// Load plugin specific language pack.
tinymce.PluginManager.requireLangPack('img_assist');

commenting that line remedies the problem for me in at least IE6, even with TinyMCE Image Assist plugin and the Image Assist Icon activated.

i don't really understand the internals of tinymce, but it seems as though loading the language pack causes the plugin to not finish being created.

sun’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

As far as 6.x-3.x is concerned, please update to the latest development snapshot. At least the issue mentioned in the last follow-up is fixed in there. All others should equally report back whether the issue has been fixed.

That said, 6.x-3.x is considered experimental. If you do not want to help in development and rather want to be on the safe side, I highly recommend using Image Assist 6.x-2.x, which is also compatible to Wysiwyg API, but will only see patches and improvements that are heavily tested and known to work. 6.x-3.x instead has been created to allow a faster development and integration speed between Image Assist and Wysiwyg API.

sun’s picture

I added a bold notice to the project, and also want to point to the special release notes in this issue: http://drupal.org/node/94930

That said, downgrading to 6.x-2.x should - as of now - be possible without any conflicts.

trofimchouk’s picture

The same issue with 5.x-2.x-dev(2008-Dec-28). And the same solution.

Eric_A’s picture

Priority: Normal » Critical

I tried 3.x. Same problem.

And somehow my workaround from #3 broke. (both 2.x. and 3.x) Unfortunately I'm not sure what has changed.

Drupal 6.8
Image/ Image Attach 6.x-1.0-alpha3
MS Internet Explorer 7

(2.x is in my sites/all/modules/ and 3.x in sites/example.com/modules/)

igorik’s picture

Same problem, no workaround from above works for me.
I had to disable img_assist button inside tinymce.
latest img_assist 2.x

Igorik

stopbox’s picture

Solution in #4 solved the problem for me using IE7 (I had to delete the IE cache first).

kevinquillen’s picture

Same here. #4 corrected it in IE. Thanks.

sun’s picture

Is it possible that you configured a different language than English in the wysiwyg profile for TinyMCE? Does this bug also occur if you configure English as language?

grunthus’s picture

Component: TinyMCE Plugin (drupalimage) » Wysiwyg API Plugin

6.x-0.5

Hi, I have discovered that my site has the same problem in IE7 (and in IE8 in Windows beta 7). The problem does not manifest under Firefox 3 with either Linux or Windows.

Fix #4 DID work in IE8 (not able to check 7 yet), although as mentioned above, clearing the cache is essential.
I can confirm that I do have 'en' set as the language in admin/settings/wysiwyg/profile
Will test in IE6 with wine later tonight.

Edit page never finishes loading, source shows:

Thanks

grunthus’s picture

OK, with IE6 running under wine, the page errors on edit:

Line 2
Char 1
Error: 'tinyMCE is undefined'
Code: 0
URL: node/x/edit

Applying fix #4 and CLEARING the cache does the job in IE6.

paulmckibben’s picture

I also am experiencing this same problem in Image Assist 6.x-2.x-dev, in both IE 6 and IE 7. Workaround #4 above helps, but without the language pack, the tooltip text for the image assist button reads "img_assist.desc", which would probably confuse my users.

To make it a little better, instead of commenting that line, I changed the code as follows:

  if (navigator.appName != "Microsoft Internet Explorer")
    tinymce.PluginManager.requireLangPack('img_assist');

That way, other browsers will still load the language pack.

selfuntitled’s picture

Version: 6.x-3.x-dev » 5.x-2.0-alpha1

I've got the same issue with 5.x-2.0-alpha1
The fix in post #4 also appears to work as well.

selfuntitled’s picture

Version: 5.x-2.0-alpha1 » 6.x-3.x-dev

Sorry, didn't mean to change versions for this entire thread!

ergophobe’s picture

Same problem here

IE7
Wysiwyg 6.x-1.x-dev from 25 Dec 2008
img_assist 6.x-1.x-dev from 19 Jan 2009

The solution from #4 works for me, but as mentioned in #15, I would like the button to have the correct label. Since the requireLanguagePack call fails and locks everything up and since I only want English labels, I just put the addI18n call straight into the editor_plugin.js file right after the line commented out in #4.

So now it looks like this
// tinymce.PluginManager.requireLangPack('img_assist');

tinyMCE.addI18n('en.img_assist', {
desc : 'Insert or update an embedded image.'
});

Or to put it as a patch

5c5
< tinymce.PluginManager.requireLangPack('img_assist');
---
> // tinymce.PluginManager.requireLangPack('img_assist');
5a7,9
> tinyMCE.addI18n('en.img_assist', {
> desc : 'Insert or update an embedded image.'
> });

mcload’s picture

Experiencing the same problem. Firefox works, but IE7 is broken.

sun’s picture

Status: Postponed (maintainer needs more info) » Active

What happens if we replace "tinyMCE" with "tinymce" in the language JavaScript files?

wouter99999’s picture

I had the same problem with Drupal 5 and Image assist 5.x-2.0alpha1. Solution #4 worked for me (I had to make the change in both editor_plugin.js and editor_plugin_src.js). But now there is a new problem: when the image assist popup window opens I get a javascript error: 'Drupal.settings.basePath' is null or not an object. As far as I know 'Drupal.settings.basePath' does not even exist in Drupal 5?

monotaga’s picture

subscribing

ngmaloney’s picture

I experienced the same problem as #21 wouter99999. Using D5 and tested with img_assist-5.x-2.x-dev and img_assist-5.x-2.0alpha1.

As an experiment I removed the Drupal.settings.basePath references from img_assist_tinymce.js and img_assist_popup.js and it worked. In Firebug console I am able to access the "Drupal.settings.basePath" variable for the calling page so the var does exist. Is it a JS scoping issue with the popup/iframe not getting access to the Drupal.settings var?

ngmaloney’s picture

I dug further into the issue. The Drupal global JS variable in the img_assist tinymce popup window contains significantly less variables than that on a standard page. Amongst the missing variables is Drupal.settings.basePath. As a crude work around I attempted the following which seems to resolve all problems.

On img_assist_tinymce.js add the following right after line 19:

//Hack to get BasePath working
Drupal.settings = [];
Drupal.settings.basePath = "/";

That is assuming your basePath is "/". Any suggestions on how to get the parent window Drupal JS variables into the scope of the Popups would be greatly appreciated.

I'm running the following:
- Drupal 5.16dev
- Wysiwyg API 5.x-0.5
- Image Assist 5.x-2.x-dev (2009-Jan-18)

sun’s picture

Version: 6.x-3.x-dev » 5.x-2.0-alpha1
Status: Active » Needs review
FileSize
1.05 KB

Finally some insight that allows me to provide a patch for this issue. Thanks, ngmaloney.

wouter99999’s picture

Thanks sun, the patch worked for me.

sun’s picture

Status: Needs review » Fixed

I have committed the patch in #25, which fixes the "Drupal.settings.basePath undefined" bug.

The original bug of this issue is mostly resolved as well, but needs to be fixed in Wysiwyg API: #352938: TinyMCE 3: IE6: Memory leak with Forecolor button

ngmaloney’s picture

If anyone continues to experience "Blank Pages on IE" when using img_assist, wysiwyg and tinymce using D5 it appears to be an issue with WYSIWYG API Version 5.x-0.5. Upgrading to WYSIWYG 5.x-2.x-dev seems to resolve any problems.

mcload’s picture

How about D6?

ergophobe’s picture

I did upgrade img_assist, wysiwyg, ctools etc last night and it worked fine in FF, but in IE I didn't get a camera icon in tinyMCE. No time to poke around just now though.

ergophobe’s picture

Okay, upgraded to the Feb 12 dev snapshots of Image Assist 3 and Wysiwyg 2 - everything seems to work great.

Thanks!

ngmaloney’s picture

@mcload - I believe I ran into the same problem with D6. Try running the latest Dev release of the WYSIWYG API module.

progesterone’s picture

I solved this way.

1. Follow the step in http://www.webopius.com/content/196/fix-for-tinymce-is-undefined-error-i... which is the same as in comment #18.

2. Clear the cache
Close IE and re-open it. Go to Tools >> Internet Options >> Delete Files >> Check "Delete all offline content (I'm not sure this check is compulsory but I did check) and press OK

Status: Fixed » Closed (fixed)

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