Hi,

When I try to insert an image using the drupalimage plugin for TinyMCE while using Moxie, I get an empty window.

If I disable the rich text editor and use the add image button, everything works fine.

I dont know much javascript, I have firebug enabled on FireFox and when I get the empty window, firebug states that there are two errors:

tinyMCE is not defined
initLoader()img_assist_tinymce.js (line 29)
onload( )index.php (line 1)
[Break on this error] tinyMCE.setWindowArg('mce_windowresize', false);
img_assist_tinymce.js (line 24)
tinyMCE is not defined
[Break on this error] nid = tinyMCE.getWindowArg('nid');
img_assist_tinymce.js (line 29)

Comments

shaunjohnston’s picture

This is because the directory containing TinyMCE (in the TinyMCE module) has changed since 4.x, from modules/tinymce/tinymce to modules/tinymce/includes.

On line 433 of img_assist.module,

$tinymce_js = base_path() . $tinymce_path . '/tinymce/jscripts/tiny_mce/tiny_mce_popup.js';

should be changed to

$tinymce_js = base_path() . $tinymce_path . '/includes/jscripts/tiny_mce/tiny_mce_popup.js';

zoo33’s picture

Since there is so much confusion around TinyMCE at the moment I find it hard to determine which "TinyMCE" we should target. I hope there will be some consensus soon as to what is the official TinyMCE. If there will continue to be two versions, we may have to do something like:

<?php

    if (file_exists($tinymce_path . '/tinymce/jscripts/tiny_mce/tiny_mce_popup.js')) {
      $tinymce_js = base_path() . $tinymce_path . '/tinymce/jscripts/tiny_mce/tiny_mce_popup.js';
    } else {
      $tinymce_js = base_path() . $tinymce_path . '/includes/jscripts/tiny_mce/tiny_mce_popup.js';      
    }

?>

However, I haven't found any code in TinyMCE's CVS directory that refers to the "includes" directory. Maybe I'm not looking hard enough. Some advice from the TinyMCE maintainers might be useful.

Lupin3rd’s picture

I change:

$tinymce_path = drupal_get_path('module', 'tinymce');

with:

$tinymce_path = drupal_get_path('module', 'moxie');

and now drupalimage seem to works fine... but there are some problems when i try to insert images.

manal’s picture

Lupin3rd,

I did the modification u mentioned, and now the window is no longer empty, but I still can't insert images into my node body.

When I click insert, the insert image window doesnt close, it's still there with the top bar (choose image or upload...) and below it, it shows the homepage!

I still can insert images, if I disable the rich text editor and use the add image button below the textarea.

Will White’s picture

manal, I've submitted a patch for the issue you're describing.

http://drupal.org/node/121173

zoo33’s picture

A patch was committed yesterday which affects this behavior. Please test again with the latest dev version.

manal’s picture

At first, I tested with diggersf's patch, and it worked fine.

Then I tried the latest development snapshot, and found out that the problem was solved.

Thanx a lot :-)

zoo33’s picture

Status: Active » Fixed

Great. Let's consider this fixed, then.

Anonymous’s picture

Status: Fixed » Closed (fixed)
HyperD’s picture

Version: 5.x-1.x-dev » 6.x-1.0

I use TinyMCE but there not any plug in to insert an image.
What could I do please ?

zoo33’s picture

Version: 6.x-1.0 » 5.x-1.x-dev

Please create a new issue for your problem. When you do, please specify which version of TinyMCE you're using. Also you should probably use the 6.x-2.x version of Image Assist, and combine that with the WysiwygAPI module, which provides TinyMCE.