There have been various posts about this problem (ie. it is happening to a lot of people).
Something is completely breaking IMCE so that it doesn't insert files into text areas.

Reading the other posts, it seems to be either: tinytinymce, image-cck-field, or fckeditor integration.
There are posts about imce breaking in each of these projects, plus one or two in the imce project page too.

The worrying thing is that even if all three of these modules and imce are uninstalled and removed,
when imce is reinstalled on its own, it still doesn't work! So whatever has broken it must be
leaving the error in the database after removal.

Symptoms of the problem:

. on upload, there is no confirmation message, and the file doesn't appear until manually refreshed,
· on opening imce highlights/selects all the files in the directory list
· all the 'send to..' links disappear
· when an image is selected and clicked, it opens in a new window instead of the text area

Cheers

CommentFileSizeAuthor
#5 imce and fckeditor problem.pdf466.48 KBjdl100

Comments

-Anti-’s picture

I've changed my mind about this. I think it is straight-forward web browser incompatibility.
I don't think tinymce, fckeditor or imce-cck-image are to blame.

I noticed imce wasn't working after a browser update (opera 9.2 -> 9.5)
This led me to look more closely at FF, and I noticed an error there too.

Because I'd just also installed fckeditor and imce-cck-image, and there was the same error
in both browsers, I assumed it must have been one of the modules which broke imce
rather than a browser update.

But this morning, on a clean drupal install, the issue prevailed:

· The 'send to...' link disappears completely in Opera 9.5.

Other symptoms in opera are:
. on upload, there is no confirmation message, and the file doesn't appear until manually refreshed,
· on opening imce highlights/selects all the files in the directory list
· all the 'send to..' links disappear (default, tinymce, fckeditor, imce-cck-image, etc)
· clicking the selected image opens it in a new window in opera rather than sending to the text area
· all files are highlighted when the imce browser window loads

· The 'send to...' disappeared in FF whenever the imce browsing window refreshed. However, after 30 minutes of testing it started to work properly, for no apparent reason! I now currently can't reproduce the issue on my FF. So this appears to be only an intermttent problem on firefox.

Cheers.

beholder’s picture

I confirm that image insert didn't work in Opera 9.52. In Safari, for example, click inserts image to textfield, but in Opera it's just open image on new tab.

neochief’s picture

I found the "root of evil" in opera for "send to.." bug. For example, BUEditor opens IMCE as:

//open the file browser.
function eDefFileBrowser(bURL, fURL, type) {
  eDefFileURL = fURL;
  if (typeof eDefImceWin == 'undefined' || eDefImceWin.closed) {//open popup
    eDefImceWin = window.open(bURL, '', 'width='+ 760 +',height='+ 560 +',resizable=1,modal=yes');
    eDefImceWin['imceOnLoad'] = eDefImceLoad;//set a function to be executed when imce loads.
  }
  else { eDefImceLoad(eDefImceWin); eDefImceHighlight();}//if popup is already opened. highlight the file url.
  eDefImceWin.focus();//bring the popup into view
}

//Executed when imce loads. Sets a send to opearation.(title is "Send to BUEditor". files are send to eDefImceFinish)
function eDefImceLoad(win) {
  win.imce.setSendTo(Drupal.t('Send to @app', {'@app': 'BUEditor'}), eDefImceFinish);
  eDefImceHighlight();
  $(window).unload(function() {
    if (eDefImceWin && !eDefImceWin.closed) eDefImceWin.close();
  });
}

When you want to insert the image into the page, and pressing Browse button, the eDefFileBrowser() function runs and everything works fine except in Opera browser.

It's because Opera browser DOES NOT executes second line after window.open(), it simply exits the function after pop-up creation. But if you'll execute this after popup is created all will work fine.

Currently, I have no idea how to sneak this bug.

arhak’s picture

subscribing

jdl100’s picture

StatusFileSize
new466.48 KB

I'm running into the same problems in Firefox and Safari. I've attached screenprints. When the "Browse Server" button is pressed, then the IMCE window opens but the filenames are cut off. Has anyone come up with a workaround for FF and Safari?

Jade

I found out the problem. I'm using the zen theme. I stopped using their tabs.css file (commented it out in zen.info) and now it's working like a charm.

jlevis’s picture

I am getting the same thing as shown in the screenshots in #5.

Firefox 3.0.5
Ubuntu 8.0.4 (hardy)

asb’s picture

> Images and other files can be sent to related applications from the IMCE interface by just clicking the add link or the file itself
> while previewing.

This still doesn't work in Opera 9.63/Win32.

Greetingsd, -asb

Hardcode’s picture

Hi guys,
I think you will be glad to hear about the solution that took me quite some time to figure it out. Well, not really.

The reason why it doesn't work in Opera is that Opera halts execution of parent window javascripts
and starts running those in the new window. If you activate the parent window the code resumes
but now it's allready too late.

So now to the fun part, the solution.
There is only one way to fix this, we have to manualy execute the script to show the button in the
new window as it loads.

There are 3 steps to make this work:
1. Open imceimage.js in imceimage folder and replace the line 12:
imceImage.pop = window.open(url, '', 'width=760,height=560,resizable=1');
with
imceImage.pop = window.open(url + '?imceimage', '', 'width=760,height=560,resizable=1');

We put an additional get parameter that we will check for in step 2.
2. Open imce-page.tpl.php in imce/tpl folder and put this before </body>:

<?php
	if (isset($_GET['imceimage']))
	{
		print '<script type="text/javascript">imceimageLoad()</script>';
	}
?>
              

So, we check for the GET and load the thing if present. Now all its left is the "thing".

3. Open imce.js in imce/js folder in paste this somewhere. Line 2 is nice.

function imceimageLoad()
{
imce.setSendTo(Drupal.t('Add image to @app', {'@app': Drupal.t('imceimage')}), window.opener.imceImage.insert);
return false;
}

This function is the same as in the imceimage but the last part had to be given window.opener part so that
it refrences the variable from the parent window.

And that is it, this is what it takes to make this work in opera.
Checked it in Opera in Firefox and all is good. Hope someone makes a patch or something out of this.
Tell me if it works for you.

The SteelRat’s picture

Version: 6.x-1.1 » 6.x-1.2
Component: Miscellaneous » Code
Assigned: Unassigned » The SteelRat
Category: support » bug
Status: Active » Closed (won't fix)

I am sorry, but your code stil doesn't work... In Opera I stil don't see label Add image. I see it only, when add image to Bueditor, but not in imceimage :(

HeinzS’s picture

Assigned: The SteelRat » Unassigned
Status: Closed (won't fix) » Needs review
Issue tags: +imceimage

Here is a (simple) workaround for using imceimage:
Testet with Opera, FF, IE
imce.module,v 1.23.2.5
imceimage.module,v 1.1.2.4

1) open modules/imce/tpl/imce-page-tpl.php
(or better: copy to your theme and clear your cache)
2) append a small javascript an the end before body ends

<script type="text/javascript">
if(opener.imceImage) {
  imce.setSendTo(Drupal.t('Add image to @app', {'@app': Drupal.t('imceimage')}), opener.imceImage.insert);
}
</script>
</body>

This workaround should work similar in all IMCE related moduls with setSendTo() problem.

The problem in imceimage.js:

   imceImage.pop = window.open(url, '', 'width=760,height=560,resizable=1');
// Problem: the opened window (with imce.js) is waiting for document.ready. 
// The  ['imceOnLoad'] is not exist at this moment
   imceImage.pop['imceOnLoad'] = function (win) {
      win.imce.setSendTo(Drupal.t('Add image to @app', {'@app': Drupal.t('imceimage')}), imceImage.insert);
   }

benstallings’s picture

Status: Needs review » Active

I am having the problem as described above on one of my sites, but not on another site that has the exact same versions of the software as far as I can tell. I'm using Zen, so I was excited to see the suggestion in #5 above to comment out the tabs.css file, but that didn't help, nor did switching themes. The problem occurs in all browsers I've tried -- Firefox, Safari, and IE -- and in both TinyMCE and FCKeditor. I'm currently looking for conflicts with other modules and will post again if I find anything.

benstallings’s picture

I disabled all the modules that this site had that the other (working) site did not, and uninstalled IMCE, and removed all references to IMCE in the database, and purged the system caches (and the browser caches), then reinstalled IMCE, and the problem still persists. I'm going to have to go live without IMCE and just tell the client to deal with it -- I can't afford to spend any more time with it right now. :-(

versuvan’s picture

I noticed the problem occurs when I try to edit a node. The IMCEimage works fine when adding a new node.
It also works fine in FCKeditor when editing the node body.

Maybe it's a problem with the link calling the IMCE browser in the edit node pages. [Add Image] and [Change Image].

Love the file browser and sharing capabilities.
Would be a pity if this was a show stopper cause we can't change the images.

Anonymous’s picture

On my site (D 6. t14)he 'insert into..' dissapeared.

The cause is a conflict with the 'secure pages' module (version 6.x-1.8)

The console of firefox mentioned (translated from Dutch, maybe not the exact english text):
No permission for to read property of Window.document in .
Sourcefile: http://mysite/sites/all/modules/imce/js/imce_set_app.js?r
line: 48

I tried the solution of http://drupal.org/node/578814 but that didn't help.

Disabling the secure pages module helped.

asb’s picture

@Jaapx (#14):

Obviously another case for one symptom caused by different causes - I've never used the 'secure pages' module.

Greetings, -asb

benstallings’s picture

I promised to follow up to my previous post -- a few weeks ago the problem suddenly went away. I have no idea why. I suspect I may have had a bad copy of the javascript in cache, but if so, it was cached in multiple places and resisted my attempts to dislodge it.

ufku’s picture

Status: Active » Closed (fixed)