I installed and activated Image Assist. When I click on the Image Assist button either on the FCK editor, or the button under the plain text edit window, a new window pops up but is completely empty. The html source in the popup is in the attached text file.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN">
<html>
<head>
<title>Add image</title>
<script type="text/javascript" src="/scc/misc/jquery.js?z"></script>
<script type="text/javascript" src="/scc/misc/drupal.js?z"></script>
<script type="text/javascript" src="/scc/sites/all/modules/img_assist/img_assist_popup.js?z"></script>
<script type="text/javascript" src="/scc/sites/all/modules/img_assist/img_assist_fckeditor.js?z"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/scc/" });
//--><!]]>
</script>
</head>
<frameset rows="38, *" onload="initLoader()" frameborder="0" border="0" framespacing="0">
<frame name="img_assist_header" src="" class="img_assist_header" noresize="noresize" />
<frame name="img_assist_main" src="" class="img_assist_main" noresize="noresize" />
</frameset>
</html>
Could it be that the relative paths (e.g., "/scc/misc/jquery.js?z") are messing things up? This happens on both my dev machine where the site home page is:
http://localhost/scc
and on my server, where it's
http://joecascio.net/scc
The scc is a symbolic link to the main drupal directory.
Comments
Comment #1
JoeCascio commentedOh, by the way, using Drupal 6.9.
Comment #2
e_wolf commentedDoes it work with textarea (when FCKeditor module is disabled)?
Did you copy img_assist_fckeditor.js from FCKEditor module folder to img_assist folder?
Comment #3
JoeCascio commentedJust tried disabling FCKeditor and yes, it does work!
I copied image_assist_fckeditor.js to the image_assist folder and re-enabled FCKeditor but that does not work.
FCKeditor has to be disabled, it seems.
However now, even when popup window does appear, if you try to upload select images or really do anything it generates errors like this:
warning: Division by zero in /home/jc/public_html/joecascio.net/public/drupal/sites/all/modules/img_assist/img_assist.module on line 883.
Comment #4
JoeCascio commentedDouble-checked the version number and updated this issue: 6.x-2.0-alpha3
Comment #5
dman commentedI'm getting the similar.
with fckeditor enabled, I don't even see the button (hidden by fckeditors css)
When I reveal the button with firebug, I get the empty popup described above.
If I switch to plain text, I see the button, but still get the empty popup.
If I disable fckeditor completely, all works.
I saw some errors in the log, looking for img_assist_fckeditor.js. Following the instructions on fckeditor readme to copy that js across (as above) the errors went away, but I still only get the empty popup.
Could be fckeditor changed the way it handles fields a little bit?
I see a few code notices in my logs too
- probably not fatal or related, just PHP STRICT complaining.
My modules are installed in odd places and subfolders - could be an issue.
Comment #6
dman commentedOK. I see a race condition where img_assist_fckeditor adds its scripts.
I replaced the (document level)
with the jscript deferred init wrapper
and things now happen in the right order.
... the button is still hidden for me though...
Seeing as the fckeditor project sems to take ownership of this file, I'll bump it back there for review. Looks to me like that script needs a bit more love.
for example looks like a poor-mans $(document).ready also
I Imagine you'll only be seeing this condition on fast local dev machines - may not show up on remote sites.
Comment #7
chrisivens commentedThis is a timing issue. When the img_assist_fckeditor.js runs it loads in the img_assist_textarea.js as shown above. This means that the getArgs function isn't available necessarily. I changed things so that the initLoader function is called with a delay.
I removed the onLoad function from the body of the popup window around line 590 of image_assist.module and added a timeout in a rather hacky way to the scripts around line 588 like so:
I'd like to have the time to sort this properly but deadlines are killing me. Will try and get back on to it soon.
Comment #8
Jorrit commentedPlease see #520706: Security update 6.x-2.0-alpha4 breaks FCKEditor 6.x-2.0-beta1. The loading mechanism has completely changed in 2.x-dev, please download it and try it.