Hi all,
IMCE can use front JS configuration: for example, if your front theme is using jQuery 1.9... IMCE doesn't work.
imce/js/imce.js, line 792:
$.browser.msie && $('html').addClass('ie') && parseFloat($.browser.version) < 8 && $('html').addClass('ie-7');
jQuery 1.9 relase note:
The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.
So:
Horodatage : 22/04/2013 16:21:35
Erreur : TypeError: $.browser is undefined
We should edit imce.js to be compatible with jQuery 1.9 and higher (and keep compatibilité with anterior versions).
I'm sorry, i don't know very well imce.js and i don't see exactly the impacts when removing line 792 so i can't propose anything. But I would like a patch to me. :p
Drupaling yours.
Comments
Comment #1
ufku CreditAttribution: ufku commentedNeither drupal core nor jquery_update module provides jQuery1.9. I don't think it will be an option for D7. We'll sure revise the code for D8.
Comment #2
Moderate CreditAttribution: Moderate commentedThanks for your answer.
/imce doesn't use core jquery nor jquery_update, but front theme. So if you use jquery 1.9 in your front theme, you may have issues with imce, no?
The only solutions we found are to switch to admin theme for /imce or to create /admin/imce to use it.
Comment #3
ufku CreditAttribution: ufku commentedWhat is front theme?
Comment #4
Moderate CreditAttribution: Moderate commentedThe main theme used on the website. The opposite of admin theme.
Comment #5
ufku CreditAttribution: ufku commentedIf you're overriding the default jQuery with 1.9 then you'll also have issues with jQuery UI and possibly with many other modules.
Comment #6
Moderate CreditAttribution: Moderate commentedIs it a reason to not correct compatibilité in IMCE?
There are only 2 lines not compatible with jQuery 1.9 (those with $.browser). And I think many developers need jQuery 1.9 to use last functions in their websites, no?
But if you think it's not a prioritary issue, no problem... i will patch it like i can in my project. :)
Comment #7
ufku CreditAttribution: ufku commentedI didn't say it was the reason.
The reason is stated in comment#1
If jquery update, which is the proper way to update jquery, supports 1.9 then we'll consider making the module compatible.
Comment #8
fb-multimediaI upgrade my front theme with jquery 1.9.1 too.
for staying compatible with modules developped with jquery 1.4.4, I used the jquery migration plugin :
https://github.com/jquery/jquery-migrate/
It resolve the issues of imcompatibily with modules using the $browser function and maybe others.
So I put it in js folder of my omega subtheme and I declare it in my template.php :
IMCE uses the front theme. it's charging the jquery 1.9.1 declare in template.php with MONTHEME_js_alter() but not the jquery-migrate in this MONTHEME_preprocess_html() (does somebody know why please?).
My solution for that is to use the admin_theme module and specify imce path to use admin theme.
Another solution is to modify in all>modules>IMCE>js>imce.js (ligne 792):
$.browser.msie && $('html').addClass('ie') && parseFloat($.browser.version) < 8 && $('html').addClass('ie-7');
par:
navigator.userAgent.match(/msie [7]/i)
Comment #9
nbathgate CreditAttribution: nbathgate commentedHi, i'm having this same problem, some features of IMCE file browser are not working because we need to run jQuery 1.10 for our theme.
Could you explain how you got IMCE file browser to display using the admin theme at admin/imce?
It seems that this problem is going to become more and more common as people more commonly implement themes using current versions of jQuery!
Comment #10
imclean CreditAttribution: imclean commented@ufku,
jQuery Update now updates Drupal 7 to jQuery 1.5.1/1.7.1/1.8.2, 1.9.1, 1.10.2 and jQuery UI 1.10.1 (in dev branch 7.x-2.x-dev)
Comment #11
helios.drupal CreditAttribution: helios.drupal commentedI am also facing the same issue regarding IMCE with jquery 1.9 or above.
I already have jquery migrate which added via _preprocess_html() (as suggested in above comment by fb_multimedia at #8), but jquery migrate js doesn't get included in IMCE page, and hence, the issue is still remaining.
So, I did a trick like below and get my IMCE working...
1. copy imce-page.tpl.php to my theme's template directory
2. in this copied imce-page.tpl.php file, inside head html element, after drupal_get_html_head() statement, I added jquery migrate js using drupal_add_js and with scope : header and last
3. clear theme registry
and got it worked....
Hope this way would help the others.....
Comment #12
ufku CreditAttribution: ufku commentedFixed
Comment #13
ufku CreditAttribution: ufku commentedComment #15
mmikitka CreditAttribution: mmikitka commentedI just added the jQuery Migrate Plugin to jquery_update -- see https://drupal.org/comment/8341311#comment-8341311
All the best,
matt