I want to share my jquery_update Port to jQuery 1.5 with you.

As far as jquery 1.4+ takes JSON Validation into account you have to patch the common.inc in the /misc folder. Hopefully this will get changed in the next Drupal 6 Releases. Patch is included in the archive.

If you find any bugs, please feel free to leave a comment. jQuery 1.4+ contains too many changes/improvements to we do not want to work without.

Members fund testing for the Drupal project. Drupal Association Learn more


fatcrobat’s picture

124.79 KB

forgot to remove debug log line, fixed in the version below ;)

franzkewd’s picture


klonos’s picture

Version: 6.x-2.0-alpha1 » 6.x-2.x-dev

Thanx mate! I will test this the very next time an opportunity arises.

PS: ...switching to 2.x dev branch since new stuff goes there ;)

PPS: Any chance of a 7.x port?

fatcrobat’s picture

I am not in d7 yet. Still to many modules haven't been updated or are still unstable/alpha.

klonos’s picture

...btw, in the project's page it says that D7 core ships with jQuery 1.5. As far as I know:

1. D7 final came out on Jan 05 while jQuery 1.5 was not released until Jan 31.
2. According to this D7 core issue I was following, the latest jQuery that was included in D7 was 1.4.4: #944308: Update to jQuery 1.4.4

I guess what I'm trying to say is that I am pretty sure that D7 shipped with 1.4.4 and not 1.5 and that the statement on the project's page needs to be corrected.

...scratch that.

klonos’s picture

...yep, /misc/jquery.js, line #4:

* jQuery JavaScript Library v1.4.4

Plus /misc/ui/jquery.ui.core.min.js, line #4:

* jQuery UI 1.8.7

...so not 1.8.9 as stated in the project's page.

...scratch that too. I just realized what It actually means: what is the jQuery versions one gets in the end once they have installed jquery_update. Perhaps the title instead of:

jQuery versions in Drupal core

  • Drupal 5: jQuery 1.2.6
  • Drupal 6: jQuery 1.3.2
  • Drupal 7: jQuery 1.5 and jQuery UI 1.8.9

...it should be:

jQuery versions updated per Drupal core

  • Drupal 5: upgrades jQuery from version ?.?.? to 1.2.6
  • Drupal 6: upgrades jQuery from version 1.2.6 to 1.3.2
  • Drupal 7: upgrades jQuery from version 1.4.4 to 1.5 and jQuery UI from version 1.8.7 to 1.8.9
Jupiter’s picture

Title: jQuery 1.5.2 port » Incredibly timely!
Status: Needs work » Needs review

Thanks for this - I have a custom module for a client which incorporates the latest version of galleria, and that didn't work with jquery 1.3.2. There are also ajax views, which didn't work with JQuery 1.5.

With this, I got everything to work.

Of course nobody wants to hack core (because of the kittens) but in a tight spot this let me postpone all my problems until the next Drupal upgrade! Yeah!

I might look for a way to select which version of jquery to load depending on the current path, or just disabling the default jquery for some paths and loading 1.5 instead for just those paths.

Thanks again!

Jupiter’s picture

Sorry about changing the title - silly me.

Jupiter’s picture

I think this breaks the update progress bars and wheels so that they never get notified of completion.

I think this was just because I had not applied the patch to the prod server - seems good now!

LateNightDesigner’s picture

Tried this but still see JQuery as 1.3.2 on the Status page.

fatcrobat’s picture

cleared caches and applied the patch including in this package?

LateNightDesigner’s picture

@fatcrobat: Correct. The install insists on it being 1.3.2 :(

Running Drupal 6.20, Jquery UI is at 1.6 if that matters at all.

fatcrobat’s picture

Maybe got it installed twice, running on a multisite? there is no reason for this issue, because i replaced jquery 1.3.2 with 1.5. What does the page source code header tell you? What jQuery Version is loaded?

thulstrup’s picture

It's working perfectly except when running batch operations. The batch script fails because of these two error:

Uncaught SyntaxError: Unexpected token : jquery.js:599
  jQuery.jQuery.extend.globalEval jquery.js:599
  jQuery.ajaxSetup.converters.text script jquery.js:7117
  ajaxConvert jquery.js:7016
  done jquery.js:6564
  jQuery.ajaxTransport.send.callback jquery.js:7382
Uncaught Syntax error, unrecognized expression: } jquery.js:869
  jQuery.jQuery.extend._Deferred.deferred.resolveWith jquery.js:869
  done jquery.js:6593
  jQuery.ajaxTransport.send.callback jquery.js:7382
AlexisWilke’s picture

I got the problem raised in #10, somehow. I use rsync to update my servers (man, that makes it easy!). Somehow the jquery.min.js was not getting updated. I had to touch the file in my SVN to get it to copy to the servers. Something to do with dates... probably because I first got version 6.x-2.x-dev then "applied" this .zip.

Also, in #1 the author of the patch says to patch common.inc in misc/..., it is under includes, of course.

Otherwise, it looks like it works.

Thank you.

P.S. Also, I now did many upgrades on different sites and had no problems with the batch system as mentioned in #14. update.php uses the batch system quite a bit.

P.P.S. I also tried with Gallerix which uses the "normal" batch system to upload image files and zip packages. It worked just fine too.

bonobo’s picture


beckyjohnson’s picture

This worked great for me but it broke the front page and only the front page of my site. Running Drupal 6.20. Is there any other relevant info i can give you to help me figure out why this is happening? It's pretty weird. It looks like the js files are loading too..

<script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.min.js?r"></script>
<script type="text/javascript" src="/misc/drupal.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/dhtml_menu/dhtml_menu.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/external/external.js?r"></script>
<script type="text/javascript" src="/sites/default/files/js_injector_3.js?r"></script>
<script type="text/javascript" src="/sites/default/files/js_injector_14.js?r"></script>
<script type="text/javascript" src="/sites/default/files/js_injector_15.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/pngfix/jquery.pngFix.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/views_slideshow/js/jquery.cycle.all.min.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/custom_search/custom_search.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/popups/popups.js?r"></script>
<script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.form.js?r"></script>
<script type="text/javascript" src="/sites/all/themes/custom/intel_edu/includes/jquery.hoverIntent.minified.js?r"></script>
<script type="text/javascript" src="/sites/all/themes/custom/intel_edu/jquery.innerfade.js?r"></script>


fatcrobat’s picture

if this site is public, you could leave a link, and i will have an eye on it

probably one of the js functions making trouble with jquery 1.5

beckyjohnson’s picture

http://industryeducation.right-brain.net/ Here you go. This site is still in development.

fatcrobat’s picture

currently running jquery 1.2.6 from core... ;/

beckyjohnson’s picture

welll i'm running 1.2.6 because i had to disable the module....It wasn't an option for me to leave it on while it was breaking stuff.

fatcrobat’s picture

in this case i can only propose to use firebug / chrome developer tool to find out which of your plugins is breaking your page. Chrome specially has a nice behavior for javascript debugging.

beckyjohnson’s picture

Ok I used FIrebug and I could find no errors. Then I enabled Jquery Update with the port to 1.5 and found this. See attached screenshot. It gives this result on every page, even though my drop down menu at the top still randomly works on some pages.

Meanwhile, under my status pages, it says I have 1.5 running....

I installed the js debugger extension for chrome and it didn't find any errors either...

AlexisWilke’s picture


are you using jQuery UI as well? You may need to upgrade that too. I have on my end to make sure that everything would be compatible.

Thank you.
Alexis Wilke

beckyjohnson’s picture

I am using jquery ui version 1.8.11......

AlexisWilke’s picture


Ah! That's what I have too. 1.8.11

Thank you.

fatcrobat’s picture

jquery is not your problem from my thoughts, but i bet one of your plugins is not running correctly with jquery 1.5.
There have been a plenty of changes and upgrading from 1.2.6 to 1.5 is a huge leap.

Enable jquery 1.5 (hopefully patched the core as i described).
Disable every javascript afflicted module (jquery_ui, dhtml and so on) and enable first things first.

It suxx, i know, but you don't have any other possibility.

Erm one last thought. The First Package from my initial post had wrongly some debugging (console.log) stuff in it. This would break in the most browsers, if console is not active at the time of running the request.

http://drupal.org/files/issues/jquery_update_jQuery_1.5_0.zip is the working one.

beckyjohnson’s picture

Thanks for the advice. I am going to try all of this and see what the result is. I will report back when I'm done.

AlexisWilke’s picture

I have DHTML menus, simplemenu, addthis, and lightbox2 (among other modules using JavaScript) and none have problems with this upgrade.

I used the .zip in #1 also. Are you saying that the console usage was in #0 or #1 .zip?

Thank you.

fatcrobat’s picture


jacobroufa’s picture

Using the file linked in #27 and have Better Exposed Filters installed. Enabling Ajax = Yes in my view breaks the exposed filter... I just get a spinner now with no actual loading. Anyone able to duplicate?

fatcrobat’s picture

Did you execute the patch that is part of the package?
Otherwise Json will not get validated correctly.

jacobroufa’s picture

fatcrobat - thanks! I must have glanced over it. Everything's working perfectly now!

shadysamir’s picture


marcp’s picture

Title: jQuery 1.5 port » jQuery 1.5.2 port
Status: Needs review » Needs work

#1085590: Update to jQuery UI 1.9 has more info on the IE9 issue. If there's going to be another D6 jQuery Update release, I suspect it would only happen with jQuery 1.5.2.

AdrianB’s picture


XiaN Vizjereij’s picture

Subscribing ... works like a charm

attheshow’s picture


fatcrobat’s picture

I will try my best to Port the Module for jquery 1.5.2 as well.

Anonymous’s picture

Any new progress before I take a stab at it?

fatcrobat’s picture

128.31 KB

Progress completed ;)

Run patches/drupal_to_js_proper_json-D6.patch from d6 root dir, it is taken from http://drupal.org/node/1086098. JSON Validation is required by jquery 1.4+.

If you are using my jquery_update_jQuery_1.5.zip version, first reject the changes from jQuery-1.4_plus_JSON_Validation_Fix.patch (included in jquery_update_jQuery_1.5.zip).

Test and leave comments.

bonobo’s picture

@fatcrobat - would it be more helpful to test the module at http://drupal.org/sandbox/fatcrobat/1126104 or the patch in this issue?

How is the sandbox code different than this patch?

kendouglass’s picture


fatcrobat’s picture

@bonobo - it is just an update of my previous jquery_update version in this post.

The sandbox project provides jquery 1.5.2 support as well but is not done yet and different from this module. ( i have a lot of ideas that will take place in it)

fatcrobat’s picture

Status: Needs work » Reviewed & tested by the community

status changed

Agileware’s picture

I am using the version in #41 (only since very recently) and everything is working so far (fingers crossed).

mrfelton’s picture

Also using #41 - seems to be working ok.

graytoby’s picture

I can't apply the patch. I'm using Pressflow, perhaps that's the issue. Below is the error when patching.

bash-3.2$ patch -p0 < drupal_to_js_proper_json-D6.patch
patching file includes/common.inc
Hunk #1 FAILED at 2497.
Hunk #2 succeeded at 2561 with fuzz 2 (offset -13 lines).
patch unexpectedly ends in middle of line
1 out of 2 hunks FAILED -- saving rejects to file includes/common.inc.rej
patch unexpectedly ends in middle of line

However, status report page shows jquery version 1.5.2 and everything seem to work just fine.

fatcrobat’s picture

dunno, what the actual pressflow drupal core version is

this patch is made for drupal 6.20

you can also patch it yourself, there is no magic in it (look at the comment in the patch file for the drupal ticket url)

graytoby’s picture

Current Pressflow is 6.20. I guess the patch is already included. See link below

fatcrobat’s picture

if your ajax forms (cck imagefield and so on) are working as espected than you are fine ;)

graytoby’s picture

Well, I actually run into lots of issues. All js is actually broken, in firebug I get "Uncaught Syntax error, unrecognized expression: [href^=http://]" . "^" not escaped properly?

fatcrobat’s picture

on ajax forms only, or generally?

AlexisWilke’s picture


Without that change, you'll get surprises here and there. I think update.php is one of them, I don't remember what was breaking for me, but some things would not make it right without that change. However, you are right, the main site generally works as is.

Thank you.

Trinorae’s picture

I tried the patch in #41 . I had some problem with a script I wrote in jQuery 1.5 which I wanted to work in Drupal. I had tried replacing some files, by which I got it working on my local dev-version and also on the production website. Although when I was logged in on the production website, it still used an old jQuery. Another "bug" was that the views-module wasn't working correctly anymore. When I go to administer > site building > views, the Javascript on that page fails.

After using this patch on my local dev, the views still isn't working. I wil notice whether or not it changes the other problem after I applied it to the production.

Anyway: nice that someone tries to get jQuery 1.5 to D6, because 1.2 really isn't enough!

AlexisWilke’s picture


Did the application of the patch jQuery-1.4_plus_JSON_Validation_Fix.patch report any errors? On my end I had to apply it by hand since I have modification in my version. Maybe you had a similar problem?

Thank you.

mrfelton’s picture

I take my comment back from comment #47 - there are some problems...

#1152552: JAvascript error when attempting to remove image from filefield field - has been caused by the upgrade.

It sounds very similar to #737686: Image field 'Remove' button broken and related to #1064890: Update jQuery Form to 2.64

mrfelton’s picture

Status: Reviewed & tested by the community » Needs work

Changing status.

fatcrobat’s picture

imce and filefield are not related to another.

is your issue related to imce or filefield? aren't you able to upload files inside a content type file field or from imce?


views are working for me, as expected...

try to revert common.inc to drupal 6.20 original and than reapply the patch (from drupal root), watch for error messages

views are heavily using ajaxform (this is exactly what the patch is intended for)

graytoby’s picture

Generally. I have some custom scripts, jquery cycle, slideshow, forms, calendar popups, all scripts just stop working.

Fixed now. The issue was caused by External New Tab module.

mrfelton’s picture

@fatcrobat - yes, I know they are not related. However, attempting to click on the 'Remove files' button on a filefield results in the error that I detailed in the IMCE issue. The js error is coming from a line in the code of the IMCE module, however, if you trace it back, the reason for this is to do with an error in the ajax processing done by filefield. I have no idea why IMCE is attempting to do anything when filefield throws an error.

So, to clarify. The problem actual problem relating to the jquery_iupdate is with filefield - more specifically, attempting to remove files from existing fields. See the issues that I referenced for more info on how that relates to jquery 1.5

jthomasbailey’s picture

Seems to break Panels drag and drop.

fatcrobat’s picture

Only use jquery 1.5.2 if you know, what you are doing. Use firebug or chrome dev tools to debug js.

Some selectors are no longer supportet, methods changed, ajax behavior changed completely. Only Update to jquery 1.5.2 if you know, that it might be risky in combination with modules that are using jquery.

Using plugins that are based on jquery 1.2.6 and wondering, that something breaks is no surprise ;)

mrfelton’s picture

It also seems to break the Views UI pretty badly. Clicking on any of the gear icons just results in a popup with a load of debug output.

XiaN Vizjereij’s picture

I can't confirm that. Views 2 + jQuery 1.5 here and i can click on the gear icons without any problems and get the desired settings below.

Agileware’s picture

The error in views should go away if you apply the patch in the patches directory.

There will also be many other errors if you have not applied that patch.

Trinorae’s picture

I manually applied the jQuery-1.4_plus_JSON_Validation_Fix.patch patch, since I couldn't get it working. My views are working now! Thanks for the information!

But I still have a weird problem I just noticed yesterday. I have a script using jQuery 1.5.1 . When I'm logged in as admin, the script is working just fine and using jQuery 1.5.2 . But when I'm not logged in, I'm stuck with 1.2.6 !

It seems like when I'm logged in Drupal is using the jQuery located in the /sites/[site]/modules/jquery_update/replace/-folder but when I'm not logged in it uses the jQuery located at /misc/ ..

Am I still doing something wrong?

AlexisWilke’s picture

Just to make some more noise, wanted to say that I did not notice any problem with IMCE which I use.

mrfelton’s picture

@Agileware - yes, thank you. The problems in Views went away after appliying patch, as well as my original issue with imagefield/imce.

franzkewd’s picture

Same to #62. Panels' drag and drop fail. Other than that seems working fine so far.

Agileware’s picture

Just as a note, it has a compatibility issue with the wysiwyg_imageupload module.
For details see #1153502: Support newer jQuery and jQuery UI versions

XiaN Vizjereij’s picture

It seems the Panels Drag&Drop problems are actually caused by CTools js breaking.

For details see #874388: Support jQuery 1.5.2

btully’s picture

Title: Incredibly timely! » jQuery 1.5.2 port
Status: Needs review » Needs work


sahaj’s picture


sahaj’s picture

Do Drupal 6.22 need a new patch version?

AlexisWilke’s picture

By the way, I am experiencing some problems with books. When I want to create a new book the JavaScript fails. Could this be because of this patch?

Thank you.

fatcrobat’s picture

Issue tags: -jQuery 1.5
130.33 KB

patch for drupal 6.22 still required

jquery 1.6.1 working for me as well (no single module support...)

fatcrobat’s picture

Title: jQuery 1.5.2 port » jQuery 1.6.1 port
Status: Needs work » Reviewed & tested by the community
fatcrobat’s picture

Component: Code » Documentation
balsagoth’s picture

Category: task » bug
Status: Reviewed & tested by the community » Needs work

The jquery_update with jquery 1.6.1 on #77 with drupal 6.22 don't allow create an imagefield.

fatcrobat’s picture

jep, i will dive into it, but looks like an filefield js prob so far

eric.chenchao’s picture


pvasili’s picture

+ IMCE, +Views :(
Try us a little hack: add the custom(php) block

drupal_add_js ('misc/jquery.js');

and set the work area:


Perhaps other path :)

phyadmin’s picture

The provided zip on #77 doesn't seem to include everything properly. When I try to install jQuery_update from its contents after unzipping it, the option does not appear in the module installation menu. I did install the dev version of jQuery update first, then uninstalled it.

phyadmin’s picture

Fixed by taking dev branch of jquery_update and replacing contents of replace/ directory with contents of replace/ directory provided in #77.

Honestly guys, this is shoddy work. If you're working on a dependency update that's likely to be wanted by the community, you should probably work with the module maintainers on merging your results to the development branch instead of ad hoc adding zip files to issue comment threads like a bunch of independent code cowboys. How many conflicting comment threads are users of modules supposed to be expected to traverse because you can't clean up and sync your efforts? >:/

fatcrobat’s picture

jquery 1.3.2+ can't be merged together with the jquery_update module, because you have apply a core patch to get it working

kenorb’s picture

I need at least jQuery v1.5.2 in 6.x, because of IE6, where page is not loaded properly in earliest versions.
I.e. this page: http://demos.openspending.org/openspendingjs/app/spend-browser/
doesn't work under IE6 with jQuery v1.3.2, but works with v1.5.2
jQuery bug: http://bugs.jquery.com/ticket/6498
Forum discussion: http://forum.jquery.com/topic/object-doesn-t-support-this-property-or-me...
Related: #1184704: Load different jQuery version on specified page.

emattias’s picture

I use 1.5.2 on my D6 site, since admin module doesn't work with jQuery 1.6.

But I use jQuery 1.3.2 in my admin theme to make sure that all the forms, panels/ctools config, views config etc work.

I do the same thing that jquery_update does in preprocess_page (except for replacing the non jquery code js file like, tabledrag.js etc. since jquery update has already replaced them).

Here is my theme_preprocess_page function:

 * Implementation of moduleName_preprocess_hook().
 * Replace Drupal core's jquery.js with the new one from jQuery Update module.
function nm_admin_preprocess_page(&$variables) {

  // Only do this for pages that have JavaScript on them.
  if (!empty($variables['scripts'])) {

      // Get an array of all the JavaScript files loaded by Drupal on this page.
      $scripts = drupal_add_js();

      // Replace jquery.js first.
      $new_jquery = array(drupal_get_path('theme', 'nm_admin') . '/js/jquery-1.3.2.min.js' => $scripts['core']['misc/jquery.js']);
      $scripts['core'] = array_merge($new_jquery, $scripts['core']);

      $variables['scripts'] = drupal_get_js('header', $scripts);

kenorb’s picture

Workaround loading different jQuery version on specified page:

ipwa’s picture

Duplicate issue?
see: http://drupal.org/node/1085590

We should have patches in one main thread so the maintainers can review it, commit and make a new much needed release.

Agileware’s picture

That is not a duplicate issue.
That issue is for drupal core, this one for jquery_update.

ipwa’s picture

Sorry guys, keep up the good work, hopefully this can be resolved soon and I can have the Drupal 6 branch of Jquery Reel Formatter depending on the new release.

klonos’s picture

alexweber’s picture

Nope, this thread is specifically about Drupal 6.x and the other about 7.x

klonos’s picture

Title: jQuery 1.6.1 port » jQuery 1.6.1 port (D6)

Thanx for taking the time to explain Alex. Don't mind if we make this a bit clearer in the issues' titles then.

ohnobinki’s picture

Issue tags: +IE9


drupal6 really needs a way to get, at a minimum, jQuery-1.5.2. Otherwise IE9 throws Javascript exceptions when it's loading, leaving its users with the AJAX-free fallbacks.

achton’s picture


ohnobinki’s picture

Oh, I just noticed that IE9 stops throwing those Javascript exceptions if I turn off my custom Content-Type: application/xhtml+xml. So I guess this isn't as critical as I thought in #96.

scorchio’s picture

Could someone please summarize the progress on this one? I'm really interested, because this could solve a bunch of issues with CiviCRM integration for example.

scorchio’s picture

[was a duplicate post by mistake, please ignore]

Agileware’s picture

For those looking at this in regards to getting rid of civicrm javascript conflict errors you should also check out this post #691746: Javascript Error when using CiviCRM as there has been a little discussion there.

Actually it would be good if a documentation page was created with the info from that issue, instead of an issue for an unrelated module. Then there could be an easier to find discussion on the topic.

scorchio’s picture

Agileware, you're right; I will try to do my best to document our findings about getting CiviCRM work. Thanks for the link.

jvieille’s picture


Leksat’s picture


Leksat’s picture

If someone urgently needs recent Jquery version for custom module, you can use solution I used to make Jquery Chosen plugin (which required Jquery 1.4+) work with Drupal 6.
This is not related to this issue, but may help in urgent necessity.

izmeez’s picture


keesee’s picture


j0rd’s picture


chadmkidner’s picture


paulgemini’s picture


how would folks describe the current state of this patch? I have a live site where I want Views Slideshow Slider but need Jquery 1.6...but I'm a bit wary of testing this on the site without more info about the status.

AlexisWilke’s picture

The 1.5 works for me on all my production sites. I did not try 1.6 (yet) as I don't need it...
I had the impression that the 1.6 patch was not 100% perfect, but I may be wrong.
Good luck,

LateNightDesigner’s picture

Just want to say I got this solved way back when. Apparently I had to instances of Jquery being called by two different modules. Thanks fatcrobat.

chadmkidner’s picture

Noticed that 1.5.0 has bugs in IE9 (but what else is new with IE), upgraded the jquery.js with the 1.5.2 ver and all was well. So currently I am running the 1.5.2 jQuery release on D6 and have not seen any noticeable problems yet in any of the newest stable releases of Chrome, Firefox, Opera, or in IE9. I use a lot of js too so I'd say its safe ;) If your want to test it on another browser, the website where I am running it is www.veilep.com (all sections of site).

As a side note to include some of the various modules that I have enabled on this site include: Colorbox, Views, Views Slider, Date Popup, DS, Fivestar with Voting API, Drupal for Facebook, Sections, and Ubercart with extras. I also have added some custom jQuery eye-candy here and there that aren't the use of any modules.

--take away.. D6 site using extensive use of jQuery v1.5.2 seems to be working pretty dandy. :)

UPDATE: So just upgraded to views 3.0-alpha4 and views slider 3.0 which seemingly broke all my jQuery Sliders.. All are changed to these new 'Cycles' but get the following error (Uncaught TypeError: Object [object Object] has no method 'cycle'). In process of working out, till than site is a little on the mild side with all the cool jQuery jiveness..

MrMaksimize’s picture

So this is a patch i rolled for jquery_update with the help of fatcrobat's code from here - http://drupalcode.org/sandbox/fatcrobat/1126104.git/

I know that d6 is going away soon, and its tough to maintain legacy compatibility for modules, but there are a lot of sites out there still using d6 and it's unfeasible for them to switch over to d7 just yet, but using jquery code from 3 years ago is getting really tough.

Please examine and test this patch and consider rolling it into the module.


Also, in order for this patch to work in drupal6 core, you need to patch it with this: http://drupal.org/files/issues/drupal_to_js_proper_json-D6_0.patch

However, if you are using pressflow, no patches are needed.

And the corresponding issue - http://drupal.org/node/1086098


MrMaksimize’s picture

So i had a few problems with git, and that patch is incorect. Please use the one attached here

kevinob11’s picture

#115 is working perfectly for me. Thanks @mrmaksimize!

aidanlis’s picture

Status: Needs work » Needs review
580.07 KB

Here's a patch without whitespace errors and tabs.

To apply:

git clone --branch 6.x-2.x http://git.drupal.org/project/jquery_update.git
cd jquery_update
wget http://drupal.org/files/jquery_update_17-1067290-116.patch
git apply jquery_update_17-1067290-116.patch

Then, if you're using the admin module you'll want to apply this patch (http://drupal.org/node/1354328):

git clone --branch 6.x-2.x http://git.drupal.org/project/admin.git
cd admin
wget http://drupal.org/files/1354328_admin_jquery17_error.patch
git apply http://drupal.org/files/1354328_admin_jquery17_error.patch

And that's it.

Leksat’s picture

I've applied the patch from #117 to my Pressflow installation. It works good. But in the Pressflow drupal_to_js() function updated to drupal_json_encode() from D7. So I didn't apply drupal_to_js_proper_json-D6_0.patch.

I found that all ajax requests fail. I tried to change the code of drupal_to_js() function from

return str_replace(array('<', '>', '&'), array('\u003c', '\u003e', '\u0026'), json_encode($var));

to just

return json_encode($var);

After that ajax requests work fine.

Can anyone confirm the problem?

Leksat’s picture

Also, I wasn't able to upload files until I update Jquery Form plugin to latest version (2.93 http://jquery.malsup.com/form/#download).

MrMaksimize’s picture

@leksat sorry might be a little sleepy. You were trying to get this to work in d7 pressflow?

Leksat’s picture

No. I tried it on Pressflow 6.22.

I just meant that drupal_to_js() is different between Drupal 6 and Pressflow 6.
D6: http://api.drupal.org/api/function/drupal_to_js/6
P6: https://github.com/pressflow/6/blob/master/includes/common.inc#L2489

Leksat’s picture

Problem described in #118 is not actual. I can't reproduce it since Jquery Form plugin update.

semantric’s picture

Couldn't get patches to work, so I replaced my jquery_update with the version in #77.

I encountered a problem; a setting that I added via drupal_add_js() in a template.php preprocess function was not being set.

I looked at the code and noticed this difference (+ is the original module code, - is the code from the version in the zip file in #77)

Index: docroot/sites/all/modules/contrib/jquery_update/jquery_update.module
--- docroot/sites/all/modules/contrib/jquery_update/jquery_update.module	(revision 2288)
+++ docroot/sites/all/modules/contrib/jquery_update/jquery_update.module	(working copy)
@@ -38,12 +38,14 @@
 function jquery_update_theme_registry_alter(&$theme_registry) {
   if (isset($theme_registry['page'])) {
-  	 // check if our preprocess function already exists
-     if(in_array('jquery_update_preprocess_page', $theme_registry['page']['preprocess functions']))
-     {
-     	return false;
-     }
-   $theme_registry['page']['preprocess functions'][] = 'jquery_update_preprocess_page';
+    if (count($theme_registry['page']['preprocess functions']) > 0) {
+      // If jquery_update's preprocess function is there already, remove it.
+      if ($key = array_search('jquery_update_preprocess_page', $theme_registry['page']['preprocess functions'])) {
+        unset($theme_registry['page']['preprocess functions'][$key]);
+      }
+    }
+    // Now tack it on at the end so it runs after everything else.
+    $theme_registry['page']['preprocess functions'][] = 'jquery_update_preprocess_page';

This is the change that somehow prevents my attempt to add a js setting with drupal_add_js() in mytheme_preprocess_page() from working. When I changed the module file back the the original version, everything seemed to work fine (including jquery 1.6). What was this change intended to do / why was it included?

Leksat’s picture

Issue tags: -IE9 +jQuery 1.7
135.17 KB

For those who can't apply the patch, I've attached the complete patched module. It includes:
1. Patch from #117, Jquery updated to 1.7.
2. Jquery Form plugin updated to 2.93.

The patched module works perfect for me. I faced minimum problems with contrib modules (I use a lot of them).

But. My drupal_to_js() function looks like:

function drupal_to_js($var) {
  // json_encode() does not escape <, > and &, so we do it with str_replace()
  return str_replace(array("<", ">", "&"), array('\u003c', '\u003e', '\u0026'), json_encode($var));

And this code requires PHP >= 5.2.0 (I use Pressflow - https://github.com/pressflow/6/blob/master/includes/common.inc#L2489)

In my company we tested the patched module under IE7-9, FF and Chrome.

jvieille’s picture

jQuery 1.7 does not work with Panels

aidanlis’s picture

Title: jQuery 1.6.1 port (D6) » jQuery 1.7 for Drupal 6

To make this really easy:

Here is a sandbox containing the 6.x-3.x branch which updates you to jQuery 1.7:

Here is a request to add me as a maintainer so I can commit this branch:

Here is a zip of jquery_update-6.x-3.x-dev if you cannot use git or apply patches:

Please use the issue queue on the sandbox for issues, rather than this thread (which has gotten long and difficult to follow):

klonos’s picture

EvanDonovan’s picture

Is there a corresponding issue for Drupal 7? In the Drupal 7 version of this module I really only had to change lines 123 & 128 to get the CDNs to serve up the right version (though I didn't actually add it into the module).

There would be additional files needed to replace from core, though, such as field_ui.js - see #1327440: Error: "Add existing field: you need to select a widget" when adding a field if jQuery is updated.

lanzs’s picture


lanzs’s picture

Doesn`t work CCK field widget select..

alexweber’s picture

I have succesfully been using #124 in a couple production websites with no problems whatsoever.

That said, I don't use Panels.

jvieille’s picture

Yes, same for me: everything woks but Panels...

kevinob11’s picture

I'm having the same problem with the select widget field for adding cck fields. Also doesn't work when hiding or revealing text areas in the views interface.

chadmkidner’s picture

Follow up to #113 - Not sure if I should have needed to but I download the cycles js and included in my .info file and all is well again.

CZ’s picture

The file jquery_update_1.7.zip [1] works well with the jQuery-color plugin [1] (no errors in the firebug console). The plugin requires jQuery 1.4.3.

[1] http://drupal.org/node/1067290#comment-5340730
[2] https://github.com/jquery/jquery-color/blob/master/jquery.color.js

jvieille’s picture

Maybe a naive question, but why do we have to stick with only one Jquery version?
Why is this module have to be adapted for every specific jquery version?
I would think that one would just be able to use the version that fits by (ideally) selecting one of the versions made available by uploading the jquery files in the module "replace" folder or better in the "libraries" Drupal folder? - or at least by uploading / renaming the chosen files.
(for example, 1.6 would make Panels happy)

klonos’s picture

Hey everybody! My first post in days... I am officially a full-time dad since past Thursday!!!

@jvieille: Jean, read here why: #715024: Support for Libraries API

aidanlis’s picture

@jvieille Drupal was written for jQuery 1.2, and every new version of jQuery introduces changes which are not back compatible. So every time we upgrade jQuery we need to rewrite portions of Drupal's javascript.

RobLoach’s picture

Title: jQuery 1.7 for Drupal 6 » Fix jQuery 1.7 for Drupal 6
Component: Documentation » Code
Status: Needs review » Needs work

I've committed the initial support for this, while keeping it in line with #1386294: Release jQuery 1.7 for Drupal 7. It supports using either 1.3 (default) or 1.7, but is definitely just the beginning. I combined a bunch of code I found from both the attached patches and sandboxes. Thank you to all who have been involved so far!

Let's get the other stuff in there, like the jQuery Form update, jQuery UI, etc!

squarecandy’s picture


j0rd’s picture

@RobLoach with regards to #140.

I've installed jquery_update 6.x-2.x-dev and tested it on my site with jQuery 1.3 & 1.7. Looking forward to testing 1.7, so I really enjoy this split 1.3 & 1.7 versions in the same module to toggle on and off. Great job.

jQuery 1.3 appears to work as expected. jQuery 1.7 seems to mess up colorbox (lib ver. 1.3.18) module pretty good. I've also updated colorbox to the latest version (1.3.19) which is supposed to work with jQuery 1.7, and it still messed up. Lots of JS errors in Dom Inspector.

Just posting my experience.

jvieille’s picture

I appreciate this too, but
- 1.3.2 does not work anymore for me http://drupal.org/node/1413880
- 1.7 breaks Panels (not the fault of this module though) http://drupal.org/node/866178

btully’s picture

Unfortunately, jquery 1.7 (or anything newer than 1.3.2) breaks A LOT of stuff on the node editing side of things, even with the latest jquery.form.js (2.9.5) Things like multi-fields that can be reordered by dragging in 1.3.2 do not work in 1.7. The drag handle never appears. My guess is tabledrag.js needs some updating but I'm not sure what/where.

Other things that break are some fields that use ahah.js to perform ajax requests, dynamically retrieving content when certain fields are updated. The newest jquery.form.js seems to fix file/image uploads.

But the main issue seems to be tabledrag.js. Any smart people expert in Javascript have a clue on how to fix this?

AlexisWilke’s picture

Personally I stick with 1.5 at this point and it works just fine. ahah has always had problems anyway, but I don't generally use that feature. From what I can seen, there is a ahah.js and tabledrag.js in the replace folder of jquery_update so it should use those files.

btully’s picture

Interesting, even with 1.5 I still get the tabledrag issues, which is a very important feature. In other words you can no longer drag/drop reorder blocks in the block admin page, nor can you drag/drop reorder fields within a node edit form (e.g. a node reference field with multiple fields).

Anyone know who I'd talk to about helping out with this -- perhaps someone who worked on the current version of tabledrag.js?

btully’s picture

DOH! Sorry looks like the version of tabledrag.js included in the downloads from #1 fatcrobat, #117 aidanlis and #124 Leksat do indeed fix the tabledrag issues! Apparently I was testing with the version from within the latest 6.x-2.x-dev package. Thanks to all involved! Now to figure out those ahah.js issues...

btully’s picture

996 bytes

I've resolved some of the AJAX/JSON weirdness with the attached patch to drupal.js. From what I've read, it seems newer versions of jQuery handle the JSON response differently and return an actual object rather than the string that Drupal.parseJson expects. This results in an error that the object has no substring property/method.

I've also read that the Drupal.parseJson function is deprecated in D7 and that jQuery.parseJSON is used instead. Since Drupal.parseJson is used in ahah.js as well as several contrib modules, I decided it would be less painful to update the Drupal.parseJson function and make it more friendly with newer versions of jQuery rather than patching all contrib modules to change all references to jQuery.parseJSON.

Please review the patch and let me know how it can be improved.

vorapoap’s picture

Assigned: fatcrobat » Unassigned
Status: Needs work » Active

I have tried #148(btully) and #124(Leksat)

#148 doesn't work for me, but #124 from Leksat simply does a job for me!


Rosamunda’s picture

I have "some" stuff that´s not working, and I just assume that maybe I needed the jquery update to 1.7+. I´ve used the patched version in #124 and the problem is still there...

Any news on this?


krisrobinson’s picture

#124 breaks my Admin module and Views 3 module.

rjbrown99’s picture

I'm using 6.x-2.x-dev as of the latest commit, with version 1.3 of jquery. What I am seeing are attempts to serve the following path -


... and that seems to have been removed with the commit from Rob Loach here which corresponds to the comment 140 earlier in this thread. So at the very least, that patch is having some issues as something is still looking for the constant that was removed.

EDIT - my bad, this is related to my use of the ajax_load module. They hardcoded the use of JQUERY_UPDATE_REPLACE_PATH into that module. Perhaps this is something to point out in documentation when this finally makes its way out into a release version, and in the meantime here is my new ticket in the ajax_load issue queue: #1675032: Remove use of JQUERY_UPDATE_REPLACE_PATH constant.

rjbrown99’s picture

OK, so ctools is also using that hardcoded JQUERY_UPDATE_REPLACE_PATH constant. See the function ctools_js_replacements() in ctools.module. Given that other modules seem to have built dependencies on it, would it be best to rethink the approach here and keep that constant intact in jquery_update?

In the meantime, I opened an issue in the ctools queue: #1675062: Remove use of JQUERY_UPDATE_REPLACE_PATH constant.

In both of the above cases (ajax_load and ctools), simply re-adding the constant to the top of jquery_update.module fixes things.

 * The path to the jQuery files that need to be replaced.
define('JQUERY_UPDATE_REPLACE_PATH', drupal_get_path('module', 'jquery_update') .'/replace');
psegarel’s picture

I don't understand the logic of implementing JQuery with Drupal knowing that a jQuery update will eventually break functionality.

If JQuery's updates are not backward compatible, it looks like it would have made sense to namespace the version that ships with Drupal 6 so that it can run alongside a newer version? The responsibility would then fall on the modules to either adapt to the Drupal version or update to the latest JQuery release. Wouldn't it?

man-1982’s picture

Title: Fix jQuery 1.7 for Drupal 6 » Fix jQuery 1.7 for Drupal 7 modules field_ui
Category: bug » support
Status: Active » Patch (to be ported)
12.44 KB

Dont work select widgets type, when create a new type of field in node type (admin/structure/types/manage/node_type/fields). It`s little bug in field_ui.js and this is pathc resolved it :)

brandenlhamilton’s picture

The attached patch simply updates against the 6.x-2.x (DEV) head to bump the version of jQuery included to 1.7.2

brandenlhamilton’s picture

The attached patch implements #156 exactly, only now generated from the project root directory so that it can be applied without prior knowledge of where I generated the diff. (oops)

brandenlhamilton’s picture

The attached patch implements #153, however, updated to reflect new folder structure of the latest 6.x-2.x branch. Also explicitly labels the constant as deprecated. It appears the maintainers intention is that jquery_update_jquery_path() should be used going forward.

gateway69’s picture

I just ran into this issue as well, when will the patch be submitted into the module?

bdlangton’s picture

This is a fix to the #158 patch. The constant needs to be defined to the path of jquery_update/replace, not jquery_update/replace/jquery/1.x.

ispboy’s picture

Thanks. It works fine with pressflow.

ispboy’s picture

i found that when editing views, the [Group multiple values] dropdown not work.
now, i've changed to use jQuery Multi module.

chadmkidner’s picture

Title: Fix jQuery 1.7 for Drupal 7 modules field_ui » Fix jQuery 1.7 for Drupal 6

Changing the title back as this page is for Drupal 6, if anyone's looking for the Drupal 7 support for jQuery look to http://drupal.org/node/1386294

OnkelTem’s picture

Status: Patch (to be ported) » Active

CCK Widgets doesn't work. What it is supposed to do with that?

chilic’s picture


Not work admin page CCK Widgets and upload/delete image or file with ajax.

digi24’s picture

I tried the current 6.2-dev and various jquery_ui and form versions. (I took special care of Drupal parseJSON/jQuery parseJSON) Dragging works and the Views UI are working.

But I have trouble with the filefield upload widget (HTTP Error 0) and the ctools modal (stuck loading). Is one of the two things working for anybody and if so, could you comment on your setup?

DamienMcKenna’s picture

FYI I submitted a patch to resolve this in CTools: #1675062: Remove use of JQUERY_UPDATE_REPLACE_PATH constant

milovan’s picture

Is drupal_to_js_proper_json-D6.patch necessary? Because currently it breaks some stuff like module webfm. More info about problem posted on te issue where patch is coming from.

markcarver’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 reached EOL (end-of-life) on February 24, 2016.