IMCE comes so close to working with widgEditor. The problem is that there is a javascript error when selecting the image to insert.

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLInputElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://xxx.com/sites/all/modules/imce/imce_set_inline.js :: imceInsertAtCursor :: line 32" data: no]

Looks like cursor position is lost in the textarea, when the 'insert image' IMCE link is clicked. Any workarounds?

Comments

ngaur’s picture

Category: feature » bug

+1 for this problem. I'm getting exactly the same problem.

With TinyMCE, I can drag images across from the IMCE window to where I want them, which is a workaround of sorts, but presumably not how IMCE is supposed to work, and the image is inserted witha link to an internal IMCE function which then needs to be removed.

Even if it did work, the 'add' link is too small to be obvious for casual users. It might be better to have buttons for 'insert' and 'finished' at the bottom of the dialog, where the 'insert' one inserts the currently selected image, and the 'done' button closes the dialog. Failing that some instruction text is needed within the dialog.

ngaur’s picture

After assessing this further, it seems that the problem is with IMCE being initiated via the 'add image or link' bit and then trying to insert text via standard textarea methods regardless of the type of editor involved. TinyMCE has a method for this purpose. Presumably widgEditor does too.

The error given here is the same one I see when the wrong method is used to insert with TinyMCE. I'm not using widgEditor. Same problem, but maybe a slightly different solution.

David Lesieur’s picture

Status: Active » Closed (duplicate)

There is more info in http://drupal.org/node/168686, so I'm marking this one as a duplicate.