Info:

OS: Vista
Browser: IE 8.0
Drupal: 6.16
Wysiwyg: 6.x-2.1
Ckeditor: 3.2.0.5205
IMCE Wysiwyg API bridge: 6.x-1.x-dev (2010-Mar-12)
IMCE: 6.x-2.0-beta1

Browsing in IMCE double clicking a file will open the file in a new browser window instead of passing the file url back to the WYSIWYG editor dialog.
So after two days of tracing through all of the modules both in php and in the javascript files I finally found the one element causing all of my woes.

I determined that in Internet Explorer the browser can't reference abstract functions by reference from a child window to a parent window. For some odd reason IE sees the anonymous function as an object.

All other browsers FireFox, Opera, Safari/Chrome see the function as a function and of course work as expected.

Current Code:

imce/js/imce_set_app.js

line 83
//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.
var isFunc = function(str, scope) {
  var obj = scope || appWindow;
  var parts = str.split('.'), len = parts.length;
  for (var i = 0; i < len && (obj = obj[parts[i]]); i++);
  return i == len && $.isFunction(obj) ? obj : false;
}


Patched Code:

imce/js/imce_set_app.js

line 83:
//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.
var isFunc = function(str, scope) {
  var obj = scope || appWindow;
  var parts = str.split('.'), len = parts.length;
  for (var i = 0; i < len && (obj = obj[parts[i]]); i++);
  return i == len && ($.isFunction(obj) || typeof(obj) == 'object') ? obj : false;
}

Now the double click, image click, and "insert file" button sends the image/file reference in IE just like all of the "good" browsers. :)

CommentFileSizeAuthor
#11 imce.isfunction.patch761 bytesufku
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emptyvoid’s picture

Status: Needs review » Patch (to be ported)

Changing status so maybe someone will take a look at this and give feedback and or integrate the small change to a release.

ufku’s picture

Category: bug » support
Status: Patch (to be ported) » Active

I can't reproduce this bug and nobody has reviewed this patch.
Please make sure this issue is not specific to you.

ccoppen’s picture

This issue is not specific to him.

I have tested it in Firefox 3.6, Chrome 5, and IE8 (and compatibility mode).

The "Insert File" link disappears on IE. It's there on Chrome and Firefox.

Using IMCE 6.x-2.0-beta3

I can confirm that the patch works fine.

ufku’s picture

Can you please find out what you have in common?
Modules, themes etc.

ccoppen’s picture

Custom theme.
CKEditor 3.2.1
IMCE Wysiwyg API bridge 6.x-1.x-dev
Wysiwyg 6.x-2.1
IMCE 6.x-2.0-beta3
Drupal 6.17

This issue only happens on IE 8.
Other browsers seem fine.

nauthiz693’s picture

I have the same problem:

Custom theme for front end
Admin module with Rubik theme for backend
Wysiwyg 6.x-2.1
IMCE Wysiwyg API bridge 6.x-1.1
IMCE 6.x-2.0-beta3
CKEditor 3.2

nauthiz693’s picture

I can also confirm that the patch works for me. Thanks!

Ives’s picture

Same issue, good fix.
Nice work!

leon85321’s picture

Thx for this fix!!
Confirmed #0 patch works!

ufku’s picture

Does everybody here use jquery_update?

ufku’s picture

Title: ICME onclick events and send to editor with WYSIWYG API in IE8 » Workaround for isFunction change in jquery 1.3
Version: 6.x-2.0-beta1 » 6.x-2.x-dev
Status: Active » Needs review
FileSize
761 bytes

I think this is about the $.isFunction changed in jquery 1.3. It is not accurate in IE.
Attached patch uses the code from jquery 1.2.6.

ufku’s picture

Status: Needs review » Fixed

Committed to dev branch.
You can test it there.

Status: Fixed » Closed (fixed)

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