I'm working with a client that has a jQuery version dependency (1.7.1 or higher is required), which is easily handled by the jquery update module. However, once that is complete, the "File Browser" functionality no longer works. IMCE editor opens, I select the file, and submit... but it never attaches and I'm left with a select field again.

I know that this is not a bug because it works fine with jQuery 1.5 and below, hence I'm labeling it a feature request.

I'm comfortable with digging in to fix this, but any pointers where to start would be awesome. I'm also available in IRC.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

laur3ntlapo’s picture

I have the same issue. Im using jQuery update -> 1.7, and i can't insert image using the IMCE File browser.

pyQlo’s picture

Same issue here with jquery update 1.7.
I've also no idea where to start for a workaround - Firebug throws no errors.

eusonic’s picture

Check out #1524944: Allow different version for administrative pages, comment 33. There is a patch for jQuery Update that allows you to use different versions for admin and front-end themes. This patch fixes this issue perfectly.

-Cameron

eXoSaX’s picture

FileSize
20.28 KB

I have the sam issue. I am using the latest IMCE module with latest File Sources module.
This is what happens when I Insert a file from IMCE:
IMCE problem screenshot
JavaScript error doesn't happen and in Drupal log there is also no error. I am using jQuery 1.7 with jQuery Update. When I switch to 1.5, it works fine. I am also using ImageField Focus module and I tried without it, but the issue persists.
I don't like the solution in #3. Is that the only one that can fix this issue?

blackandcode’s picture

I have the same bug as eXoSaX.

Does anyone have similar problems???

This is good option and good module but without this it is useless...

IS THERE ANY SOLUTION?

fearlsgroove’s picture

This is the result of using jquery > 1.6 (via jquery update). The attached (fugly) patch seems to work with both jquery 1.5 and 1.8, and should also work without any jquery update installed. I have not test that last scenario.

fearlsgroove’s picture

Version: 7.x-1.7 » 7.x-1.x-dev
Category: feature » bug
Status: Active » Needs review

oops NR

rojesaga’s picture

oops? hehehe, I apply the patch and nothing happen.

krima’s picture

The patch at # 6 works thanks (tried with jquery 1.8)

quicksketch’s picture

Thanks for narrowing down this problem @fearlsgroove!

if (jQuery.fn.prop) { jQuery(this).prop('disabled', false); } else { jQuery(this).attr('disabled', ''); }

A much easier way of handling this problem is simply using $(this).removeAttr('disabled'). $.removeAttr has existed since jQuery 1.0 and works consistently across all versions.

quicksketch’s picture

Status: Needs review » Fixed
FileSize
653 bytes

Tested and committed the attached patch. Thanks guys!

siramsay’s picture

Version: 7.x-1.x-dev » 6.x-1.8

I having exactly same issue with drupal 6.25 & 6.28 upgrade from 6.x - 1.4 to 6.x- 1.8

I have not updated jquery core at all.

EDIT*
downgraded on 6.25 & 6.28 install to 6.x - 1.7 and problem has gone

quicksketch’s picture

Hi @size, in which browser were you experiencing this problem?

siramsay’s picture

hi @quicksketch

FF20

I will test on a install I have jquery update (1.3.2) running on today and report back. but from what you say this shouldn't be the problem.

arigatou!

siramsay’s picture

Status: Fixed » Closed (fixed)

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

danmed’s picture

Status: Closed (fixed) » Needs review

Hello,
sorry to re-open this thread but I am having the same problem, and the patch proposed in #11 cannot be applied (source code does not match my version).
FileField Sources version: 6.x-1.8
Jquery UI version: 1.7.3

This happens with FF (20.0.1), Chrome, IE9... under Win. 7

For your information, the code I have in imce.inc is:

  $element['filefield_imce']['file_path'] = array(
    // IE doesn't support onchange events for hidden fields, so we use a
    // textfield and hide it from display.
    '#type' => 'textfield',
    '#value' => '',
    '#id' => $filepath_id,
    '#attributes' => array(
      'onblur' => "if (this.value.length > 0) { jQuery('#$select_id').triggerHandler('mousedown'); }",
      'style' => 'position:absolute; left: -9999em',
    ),
  );

Note: my filefield can have multiple values. After selecting a file in IMCE, my selection does not show up. But if I hit "Add another", then my previous selection does show (that's a workaround, but hard to explain that to back office users...).

Maybe this is exactly this situation: #2004922: IMCE Not kicking start onblur event when using OS X browser.
and the issue is not limited to OS X browsers.

Thanks for your help.

md2’s picture

The following patch brings the current 6.x-1.8 and 6.x-1.x-dev branches back inline with the fix from #11. I also noticed that the $element['filefield_imce']['file_path'] array defines a textfield but the rendered HTML was still showing a hidden field. The patch also contains a change to theme_filefield_source_imce_element($element) to output the HTML as a textfield and not a hidden field. If this is wrong I apologise and can re-roll the patch, but it seemed to make sense to me.

I've tested across Chrome,FF,Safari,IE7-9 and all seem to work fine.

Cheers,
Mark

Sarah_G’s picture

I reverted filefield_sources back to version 6.x-1.7 and my IMCE inserts as expected.
Hoping the fix gets included in the next version.

j-conk’s picture

The file browser is still not working for me. The file browser works with 6.x-1.7, but not with 6.x-1.8, 6.x-1.9 and 6.x-1-10.

osopolar’s picture

Version: 6.x-1.8 » 6.x-1.10
Issue summary: View changes
Status: Needs review » Closed (duplicate)

IMHO it's just a Problem with the backport in issue #1334378: Insert file on IMCE fails in some Browsers.