Hi,
Please don't shoot me for this, but I have been tweaking around with jQuery 1.4.2 for the sake of experiment, and I actually need it as well. I adjusted the jquery_update module so that I have jQuery 1.4.2 everywhere except for users with 'administer views' permission. All things that need jQuery 1.4.2 work nice, and so do the other libraries (fancybox, jquery.jqtransform, etc). The only issue so far is that my ajax submit form doesn't work anymore. I used it for the simplenews subscription form. When submitting anything, a browser popup appears saying: 'an error occured'. Using jquery.form.js v1.2 provided by Drupal core has the same result as using jquery.form.js v2.43 provided by the jquery_update module.
The only issue I found about it is this, but it is not very helpful yet: http://forum.jquery.com/topic/jquery-1-4-1-problem-with-the-form-plugin . I might explain my issue there as well later.
Because I know I shouldn't touch jQuery 1.4.2 at all, I've set the priority to 'minor'. I just post this to share it and for future reference.
Tnx for your time and interest.
Cheers,
Danny
Comment | File | Size | Author |
---|---|---|---|
#24 | jquery_update_775924.patch | 375.51 KB | drewish |
#20 | jquery_update-775924.patch | 238.55 KB | boztek |
#15 | jquery_update-775924.patch | 238.52 KB | realityloop |
#1 | an_error_occured.png | 41.3 KB | Danny_Joris |
Comments
Comment #1
Danny_Joris CreditAttribution: Danny_Joris commentedThe Drupal messages are not shown after submitting, nor are the javascript callbacks. Submitted email addresses do receive their confirmation mails. So i guess it is not an issue with jquery.form.js .
+ The result of using Firebug > Console on the form with jQuery 1.3.2 and 1.4.2 are the same for both. The results of Headers, Response, Post and JSON are the same.
The profile results on both versions are very different though.
Comment #2
Danny_Joris CreditAttribution: Danny_Joris commentedI think it is the JSON dataType call that is not working. I might try with dataType: 'html' instead...
From the jquery api:
Comment #3
Danny_Joris CreditAttribution: Danny_Joris commentedHurrah! Solved, thanks to Heine on irc chat. He pointed me to a patch for drupal 7: http://drupal.org/files/issues/do-479368-u-escape-sequences.patch , discussed at #479368: D7: Create RFC compliant HTML safe JSON .
The only thing I had to do is replace one line in includes/common.inc of D6. In the function drupal_to_js($var) I had to replace this line (manually, because the patch is for D7):
With this one:
This means I don't need to use datatype 'html' and I don't need to change anything to ajaxsubmit.js.
Again, big thanks to Heine for helping me with this.
Marking as fixed.
Cheers,
Danny
Comment #4
Danny_Joris CreditAttribution: Danny_Joris commentedOk, little update from Heine. :)
Heine suggested that I could replace the contents of the entire drupal_to_js function with the contents of the drupal_json_encode function which is new to D7. I don't know how, but it works fine. Json_encode can deal with array, objects and other types. I know God will kill some kittens for this, but this will be backported to D6 core soon.
So
becomes:
It is not recommended to use this on production sites!
Comment #5
bstoppel CreditAttribution: bstoppel commentedI decided to try this patch. I am really looking forward to jQuery 1.4.2 as well as jQuery Tools 1.2.
From what I can tell, everything works except drag and drop reordering doesn't work anywhere in the Garland Theme (views, cck, etc.) Actually, reordering doesn't work period. With this patch, there is not even the gracefully degraded form text boxes.
Comment #6
bstoppel CreditAttribution: bstoppel commentedIf the patch referred to in comment #8 of this post, http://drupal.org/node/653580 , is applied to tabledrag.js, draggable reordering works with jQuery 1.4.2.
Here is the aforementioned patch http://drupal.org/files/issues/jquery_1_4_653580_1.patch
Comment #7
Danny_Joris CreditAttribution: Danny_Joris commentedHi bstoppel,
I didn't mention that I tweaked the jquer_update module for this. I added a separate jquery 1.4.2 and added/replaced the jquery_update_jquery_path function in jquery_update.module. Any role with permission to 'administer views' can only use jquery 1.3.2 . All the others - anonymous users - get to use 1.4.2 because I only needed the latest version for the front end.
Hope this helps. Or let me know if I'm doing something terribly wrong... :)
What do you mean with patch in comment #8?
Comment #8
srobert72 CreditAttribution: srobert72 commented@Danny_Joris #7
I exposed your solution here : #685060: Get ready for 1.4
Comment #9
bstoppel CreditAttribution: bstoppel commentedThe patch in comment #8 refers to the other issue queue not this queue. That patch makes tabledrag.js aka "drag and drop rearranging" or "drag and drop resorting" work with jQuery 1.4.2.
Comment #11
jsims281 CreditAttribution: jsims281 commented@Danny_Joris #7
That's fantastic! Thanks for the inspiration! I tweaked it a little to this, which just loads the old jQuery when you are in the admin section
Comment #12
chromaloop CreditAttribution: chromaloop commented@ jsims281 + @Danny_Joris
Thanks for providing these solutions. I was searching for hours and was about to give up until I found your posts. Both worked like a charm!
Comment #13
Stan.Ezersky CreditAttribution: Stan.Ezersky commentedGood, but we must disable jQuery 1.4.2 on add/edit pages
Fixed jsims281's solution
Comment #14
jsims281 CreditAttribution: jsims281 commentedAha you're right there Stan.Ezersky, good fix thanks for that. Without it, ajax won't work on any add or edit pages!
Comment #15
realityloopPatch for #13
Creates jQuery 1.4.2 files as well
Comment #16
realityloopReopening for possible inclusion in jQuery Update
Comment #17
JohnnyX CreditAttribution: JohnnyX commentedSo jquery 1.4.2 isn't available for wysiwyg editors? Editors are used in edit mode. Or I'm wrong?
Comment #18
realityloopJohnnyX, once the following patch get added to core we'll be able to use 1.4.2 anywhere in the site:
http://drupal.org/node/479368
Comment #19
Déja CreditAttribution: Déja commentedI've applied the patch in #15 above in conjunction with the drupal_to_js patch at http://drupal.org/node/479368#comment-3198886
After testing and use for about a week, I look forward to this being included in jquery_update as soon as the bug is fixed in core.
I've written more about this issue at http://echodittolabs.org/blog/2010/08/drupal-6x-jquery-142-new-possibili...
Comment #20
boztek CreditAttribution: boztek commentedPatch in #15 wasn't applying to dev so I recreated.
Comment #21
ClearXS CreditAttribution: ClearXS commentedHi; I don't know how to get the + away from >1600 lines, except manually... Do you have a file without the >1600 pluses?
Edit (Sep 24): I have a Cpanel host account, so the procedure mentioned by next poster, doesn't seem to work for me? Should I install Eclipse? Maybe I should fax my photo ID to the hoster requesting SSH/Shell access?
Comment #22
srobert72 CreditAttribution: srobert72 commentedSee this procedure
http://drupal.org/patch/apply
Comment #23
jsims281 CreditAttribution: jsims281 commentedIt's probably easier (in your case) to apply the patch using your desktop machine rather than via ssh.
You can apply patches using a Windows machine in a variety of ways, explained in a bit more depth here: http://drupal.org/node/60179
If you are on Mac OSX there is information here: http://drupal.org/node/60818
edit: this looks like a very easy solution for Windows users: http://drupal.org/node/75790#comment-2615716
Comment #24
drewish CreditAttribution: drewish commentedI think the approach taken of conditionally choosing a jQuery version based on URL will cause more headaches than it solves.
The attached patch simply updates jQuery to 1.4.2 and backports the following fixes from D7:
- #653580-127: Upgrade to jQuery 1.4
- #737632-15: tabledrag: menu children take top of left region or not at all in IE
- #737596-5: tabledrag.js: $(".indentation", testCell).get(1) is undefined
Comment #25
drewish CreditAttribution: drewish commentedRealized this is totally in the wrong queue. Probably should be marked as a duplicate of #685060: Get ready for 1.4 but the comments over there are a wasteland of subscribes and +1s.
Comment #26
drewish CreditAttribution: drewish commentedComment #27
johncionci CreditAttribution: johncionci commentedIm very new to drupal dev in general so im not sure of this is even possible but from solution provided in #13,
can you add something like this.
if admin or.... use core version...
else if use googles cdn versions... (for faster jq)
else use 1.4.2... (for users without access to google)
thanks.
Comment #28
Tommy Kaneko CreditAttribution: Tommy Kaneko commentedFor the benefit of Googlers looking for a solution to and Ajax error in Panels because of using Jquery 1.4.2, I can confirm that the solution in comment #13 worked a charm.
It is a very good workaround of using jquery 1.4.2 on most of your pages while keeping your admin section using 1.3.
Comment #29
lawx01 CreditAttribution: lawx01 commentedI just patched jquery_update with #13, although it is not yet a 'core' solution, it works like a charm and saved me a lot of time.
Thanks Stan.Ezersky
Comment #30
aspedia CreditAttribution: aspedia commentedSubscribe
Comment #31
Stan.Ezersky CreditAttribution: Stan.Ezersky commentedShort and graceful code:
jQuery1.4.2 is disabled for admin, edit, add pages
Comment #32
jsims281 CreditAttribution: jsims281 commented#31 Great job, this is working great for me.
Using 1.4.2 still causes issues with some other modules though - I found issues with XML Sitemap, as it a "batch" URL in it's sitemap generation page, instead of add/edit/admin.
For this reason, I wonder if it would be worth being able to choose a set of URLs to ignore in the administration area for jQuery Update module rather than adding them to the code each time a new one crops up?
Comment #33
giorgio79 CreditAttribution: giorgio79 commentedWhy are you saying "Good, but we must disable jQuery 1.4.2 on add/edit pages"
Everyone should or your team has some specific requirements? Will those pages stop working?
Comment #34
dmcgrew CreditAttribution: dmcgrew commentedI've tried a few solutions from this thread but none of them seem to work in Firefox or IE. No problem with Safari/Chrome though. Weird! Any ideas??
Comment #35
trickyricky26 CreditAttribution: trickyricky26 commentedThank you Stan.Ezersky ! This worked perfectly. #31
Comment #36
llbbl CreditAttribution: llbbl commentedjquery 1.4.4 breaks views and CCK for me using drupal 6
Comment #37
trungonly CreditAttribution: trungonly commentedWhy don't we create an hook / api for
hook_jquery_path()
so we can define any custom paths in our custom modules?Comment #38
Macronomicus CreditAttribution: Macronomicus commentedAll this talk of upgrading only to not use it during most of the site usage /admin/edit/etc I found these instructions to be the best option for now. http://drupal.org/node/1058168
Comment #39
claar CreditAttribution: claar commentedComment #40
darkknight7 CreditAttribution: darkknight7 commentedThanks a lot Stan, I'm quite new to Drupal, and i think this issue was making me question if Drupal was the right way to go, but those doubts are long gone now, there is definitely a great community here.
Thank you again!
Comment #41
madhusudan CreditAttribution: madhusudan commentedI am using pressflow. and right now facing lots of issues with jquery!.
Do i need to apply this patch..? will this work for pressflow.?
Comment #42
gumol CreditAttribution: gumol commentedCode from #31 doesn't work for draggable fields in Webform form components page.
Comment #43
careym86 CreditAttribution: careym86 commentedHey Guys, I also had some issues with wanting to have a different jquery version for a particular page only. I am running D6 with jQuery 1.3.2 courtesy of jquery update module.
I wanted to use the NivoSlider library ONLY for the frontpage, which requires a jQuery minimum version of 1.4.2. When using the code snippets from #7 and #11, it worked, however, I noticed that the node content forms were playing up as a result of changing the jquery version and filtering on the strpos ('admin').
Here's my version of the jquery_update_jquery_path function, which lets me call the function from my template.php file, (see below for code snippet and example use): Please note that the jquery files still need to be put in the jquery update module directory, in the 'replace' folder.
Code Snippet:
Example Use:
I hope this helps someone else. Also, this is my second post ever on drupal.org, so please give me feedback on if the way of posting is good/bad/clear/unclear, etc so I know what to do in the future.
Goodluck.
Comment #44
btully CreditAttribution: btully commentedsubscribe
Comment #45
Stan.Ezersky CreditAttribution: Stan.Ezersky commentedcareym86, Thanx!
Solution for frontpage (not node content!)
Example from page.tpl.php
Comment #46
polmaresma CreditAttribution: polmaresma commentedI'd modified this to solve problems on webform edit page.
jQuery1.4.2 is disabled for "admin, edit, add, webform edit" pages
Comment #47
tea.time CreditAttribution: tea.time commentedRegarding the edit to
jquery_update_jquery_path()
in comments #13 and #31:The condition
became problematic for me because I have a front-end page that happens to use 'edit' in its path alias. I adjusted to:
Comment #48
tea.time CreditAttribution: tea.time commentedAlso, I ran into a case of drewish's comment (#24) about URL path not being the best condition to check:
I am using core's tabledrag.js for a custom form on the front end (via drupal_add_tabledrag()). Now, jquery_update 6.x-2.0-alpha1 provides its own version of tabledrag.js, updated to work with the version of jquery that it provides. So I needed to check whether tabledrag.js was being used on my front-end page, and if so, don't use a newer version of jquery than provided by the module.
I added an optional argument to the path function:
jquery_update_jquery_path($force_older = FALSE)
and checked it as another condition for not updating beyond module version:Finally,
Obviously this only checks a very specific condition; jquery_update also provides patched versions for a small bunch of files -- see
jquery_update_get_replacements()
-- but I didn't experiment to see if any of those others would conflict with a later version of jquery than the module's version.