I installed FCKeditor 'fckeditor-6.x-1.3-rc1' and it works OK. I then installed Image Assist version 1.16.2.1. The Image Assist icon shows up below the FCKeditor window. When I click the icon another window opens up and it's blank -- nothing shows in it. The path for that window is http://shastacrystals.com/img_assist/load/fckeditor?textarea=body

If I disable FCKeditor, go back to editing a page, click the Image Assist icon, another window opens up and I can see the images I uploaded. The path for that window is http://shastacrystals.com/img_assist/load/textarea?textarea=body

I can't get both FCK editor and Image Assist to work together.

Can anyone help?

CommentFileSizeAuthor
#6 6.x-2.0.patch4.51 KBArtur Formella
#6 6.x-1.3.patch4.47 KBArtur Formella
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Diseree’s picture

I have same problem with 6.x-1.3-rc2. Error console of Firefox 3.0.3 shows 'initLoader is not defined'.

Copy sites/all/modules/fckeditor/img_assist_fckeditor.js to sites/all/modules/img_assist.
Refresh Drupal cache and Brower cache.
Then img_assist popup on fckeditor will work with IE7 and Opera9.6.
Firefox 3.0.3 still says error, but I dunno why.

wwalc’s picture

Just to be sure we're testing it in the same environment, I'm working on Drupal 6.11 + Image Assist 6.x-1.0 + FCKeditor 6.x-1.3-rc2
No other modules, Garland theme, right?
FCKeditor is enabled by default and the the only way to use Image Assist is to press "Image Assist" button inside of FCKeditor, correct?

@cgreenberg: where did you download "Image Assist version 1.16.2.1"? Check the img_assist.module file and search for
// $Id: img_assist.module,v 1.72.2.4 2008/08/16 20:41:00 sun Exp $
let me know what do you have there.

wwalc’s picture

Some more information:
I'm able to get a javascript in FF3 with Firebug enabled, this error occurs randomly, mainly when I clear browser's cache. However, FCKeditor works fine with that error and a valid Image Assist tag is inserted.
The error that get is:

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://global/content/bindings/browser.xml ::  :: line 644"  data: no]

So if you are getting 'initLoader is not defined' error, please do the following:
- provide me a detailed list of steps to reproduce this issue, starting from a fresh Drupal installation
- ..or use contact form and send me a link to a site where I could see that bug live, because I may be missing something obvious on my local installation

lwiegand’s picture

+ subscribe

awakenedvoice’s picture

+ subscribe

Artur Formella’s picture

Status: Active » Needs review
FileSize
4.47 KB
4.51 KB

Yes! I found the reason. Please try the patch and tell us if it works.

Artur Formella’s picture

http://drupal.org/node/327894 has been marked as DUP

sámo@drupal.org’s picture

So I tried the patch, it is working in FF.

In IE7 there are still some problems. The icon appears in toolbar, but on click a popup window appears empty with javascript error. Keep the popup window open and click Image Assist icon again and everything works all right now.

When Super Nav module is enabled, Image Assist icon doesn't appear at all.

Artur Formella’s picture

Image Assist loads only one JavaScript file set in the URL.
Default is 'textarea':
http://localhost/drupal660/img_assist/load/textarea?textarea=body
it means: load img_assist_textarea.js file.

FCKeditor changes the link to:
http://localhost/drupal660/img_assist/load/fckeditor?textarea=body
it means: load img_assist_fckeditor.js file.

FCKeditor needs both files, default Image Assist functions (img_assist_textarea.js) because (at start) doesn't know the textarea state when user clicks Insert.

In img_assist_fckeditor.js loads img_assist_textarea.js:

var head= document.getElementsByTagName('head')[0];
// Create a new script object
var script= document.createElement('script');
script.type= 'text/javascript';
// Source dirname is built from the second script tag found in the document
script.src = head.getElementsByTagName('script')[1].src.match( /.*\// ) + 'img_assist_textarea.js';
// Append the new script to the header
head.appendChild(script);

In img_assist_textarea.js there is a function initLoader(), we need it in popup:

<frameset rows="38, *" onload="<b>initLoader()</b>" frameborder="0" border="0" framespacing="0">

but IE, sometimes Mozilla loads this file to late. I propose to add it to img_assist.module.

Open img_assist.module, find:

  if ($editor == 'tinymce') {
    $tinymce_path = drupal_get_path('module', 'tinymce');
    $tinymce_js = base_path() . $tinymce_path .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js';
    $output .= '<script type="text/javascript" src="'. $tinymce_js .'"></script>' . "\n";
  }

add after:

  if ($editor == 'fckeditor') {
    $editor_js = base_path() . $path .'/img_assist_textarea.js';
    $output .= '<script type="text/javascript" src="'. $editor_js .'"></script>' . "\n";	//load default functions
  }

Open img_assist_fckeditor.js, remove:

// Get the header of the document
var head= document.getElementsByTagName('head')[0];
// Create a new script object
var script= document.createElement('script');
script.type= 'text/javascript';
// Source dirname is built from the second script tag found in the document
script.src = head.getElementsByTagName('script')[1].src.match( /.*\// ) + 'img_assist_textarea.js';
// Append the new script to the header
head.appendChild(script);

Please let me know if it works

sámo@drupal.org’s picture

OK, this works for FF and IE7.
With Super Nav module the icon doesn't appear and no error occurs.

Thank you

wwalc’s picture

Assigned: Unassigned » wwalc
Status: Needs review » Needs work

CNW: patch is invalid because it assumes that img_assist module is always installed ('ImageAssist' button is added to every toolbar regardless of Drupal configuration). I guess it would be a sane approach to leave current automated way of adding a button + add some information that in case of a custom toolbar, such button should be added manually.

dmbritos’s picture

Version: 6.x-1.3-rc1 » 6.x-1.3-rc5

did you see that from localhost all works fine...why?

pieterbezuijen’s picture

Works for me, tnx!

wwalc’s picture

Status: Needs work » Fixed

Ok, so if the problem is in the missing initLoader function, let's just try adding this function to the img_assist_fckeditor.js instead of modifying img_assist.module manually. I can't reproduce this issue to see if such fix really works, but let's see if anyone reports any problems with it.

Status: Fixed » Closed (fixed)

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