Closed (works as designed)
Project:
jQuery Update
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2013 at 15:11 UTC
Updated:
20 Mar 2018 at 11:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #0.0
vvs commentedpage
Comment #0.1
vvs commentedcode
Comment #1
mathieso commentedSeems to be:
drupal_add_js('misc/ajax.js');
When this is included, I get the error. When not there, no error.
jQuery 1.8.
Comment #2
mathieso commentedHmm...
Wrapped the contents of jquery_update.js like this:
Delays code execution until after
Drupalis defined.No error message. The JS code was executed (set a breakpoint to find out). Whether it has the intended effect, I don't know.
Kieran
Comment #3
paulsheldrake commentedHere is patch to fix this problem based off the solution mathieso provided.
For pages with complex js this could slow down rendering so ideally we would find out why the ajax property doesn't exist at when the code is called but I think this is decent enough solution in the short term.
Comment #4
paulsheldrake commentedComment #5
Punk_UnDeaDmaybe I'm wrong
but at this point in the design bug fixes
Comment #6
OnkelTem commentedIMHO this is design error.
drupal.ajax is set dependent on jquery_update.ajax.fix by JQuery Update:
which makes jquery_update.js to load BEFORE ajax.js — i.e. before
Drupal.ajaxbecomes declared.Comment #7
OnkelTem commentedThis must be resolved as it breaks things.
Comment #8
Anonymous (not verified) commentedRunning into this problem today, can't run js menus on my site.
Comment #9
Anonymous (not verified) commentedJust an FYI. The patch in #3 did not resolve the problem. I had to disable jquery update module to get javascript working again on my site...
Comment #10
dzinergal commentedHi I'm getting a site wide ajax error on fields in the backend.
I've disabled the Jquery update module and still getting that error.
Not sure where to go from here. Anyone able to shed some light?
Thanks ;)
Comment #10.0
dzinergal commentedversion
Comment #11
OnkelTem commentedSorry, comments from #6 and #7 are invalid. They should be edited or removed.
Comment #12
OnkelTem commentedLooks like something is breaking load sequence. In my situation (invalid comments #6 and #7) the reason was REL module, which simply did
drupal_add_js('misc/ajax.js');and this was breaking weight of already prepared ajax.js library.Comment #13
matsjacobsson commentedI too get this problem when using Commerce Ajax Cart (https://drupal.org/project/commerce_ajax_cart). When I disable that module the error disappear.
The patch in #3 works for me though. So thanks! /Mats
Comment #14
Exploratus commentedPatch # 3 worked for me, at least in the interim. The error was causing my subsequent scripts to hang.
Comment #15
anybodyConfirming #13!
Comment #16
anybodySet the priority to major because it breaks functionality on a wide range and seems to be a design bug. Hope you agree.
Comment #17
ericduran commentedHmm, This looks like it was introduce when we added the option to use different versions of jquery for admin pages.
Can someone confirm this is an issue if you're only using one version of jQuery, or is this happening always even if you don't use a different version for admin pages.
Comment #18
sinasalek commentedIt happens with all version of jquery for me
patch in #3 fixed the problem
Comment #19
ericduran commentedYea, this patch doesn't look right, this is definitely a design error, This file should be loaded after drupal ajax not before it.
Comment #20
ericduran commentedThe proper fix for this would probably be removing the jquery_update.ajax.fix library and instead adding that file into the drupal.ajax_library after the ajax.js file.
This way it's always included right after it.
If someone is interested if not it'll have a patch later tonight.
Comment #21
adamgerthel commentedAny news on the patch? Also using Commerce Ajax cart and have the same issue. Should this be moved there?
Comment #22
Punk_UnDeaD> Also using Commerce Ajax cart and have the same issue. Should this be moved there?
bug in Commerce Ajax cart
Comment #23
joelpittet@ericduran I tried to give that a shot but failed miserably :( Can't stand the render array API...
Here's the patch just in-case it's half way there for you...
Comment #24
ParisLiakos commentedi think #20 means something like the attached patch...
for me it is only broken in IE8 and the attached patch does not fix it
(See screenshot)
I show that IE complains about ajax.js..so i went in line 625..and changed
newtonewzjust to see what happens..i refreshed the page and the error was gone...so maybe this is a drupal core bug? since this line was introduced in drupal 7.27 and http://drupalcode.org/project/drupal.git/commit/6642fbc
Comment #25
ParisLiakos commentedindeed
Comment #26
socialnicheguru commentedthis is definitely a commerce_ajax_cart issue. If I install it ajax just breaks. Too bad.
I'll leave it to better minds than mine to switch the issue to that queue.
Comment #27
maxilein commentedcommerce_ajax_cart issue solution (not yet committed): https://www.drupal.org/node/2280465
Comment #28
joelpittet@maxilein Does the latest patch there solve the problem, if so I'll commit it. It needs review/rtbc.
Comment #29
maxilein commented@joelpittet it solves the problem of the commerce_ajax_cart breaking jquery_update for rules. Yes.
Comment #30
czigor commentedRerolled #24 but it does not work for me, I still get the same error message in console. I don't have commerce_ajax_cart.
Comment #31
Punk_UnDeaD@czigor
bug in Commerce Ajax cart
drupal_add_js('misc/ajax.js'); //WTF?
drupal_add_library('system', 'drupal.ajax'); //good
Comment #32
Punk_UnDeaDComment #33
czigor commentedI still have this bug.
Comment #34
Punk_UnDeaD> I still have this bug.
So what?
when I use commerce_ajax_cart, I have bug
I replace stupid code in commerce_ajax_cart_preprocess_html
on
and I feel good
drupal.ajax - is library, not single js
Comment #35
czigor commentedBut I can't do that since I don't have commerce_ajax_cart and still have this bug.
Comment #36
joelpittet@czigor Which modules do you have installed? Could you look for this in your code? Maybe another module is doing something similar.
Comment #37
czigor commentedIt seems that one of our custom modules had the same drupal_add_js. Changing it to drupal_add_library solved the problem. Thanks!
Comment #38
localnetwork commentedLine #34 works for me.