After #1524944: Allow different version for administrative pages:
* Set jquery 1.8 for front end pages.
* Set jquery 1.7 for back end pages.
* Go to a node with a media field
* Add a file to the media field
* Save
* Edit the node
* Click on Remove next to the media field
Te site does nothing but it should show a popup. The problem seems to be that in this point (and some other places too) it's trying to load jquery 1.8:
GET ...jquery/1.8/jquery.min.js?v=1.8.2&_=1364428694695 200 OK jquery...v=1.7.1 (line 4)
GET ...ox/jquery.colorbox-min.js?mkc9hs&_=1364428694905 200 OK jquery...v=1.7.1 (line 4)
GET ...b/colorbox/js/colorbox.js?mkc9hs&_=1364428694987 200 OK jquery...v=1.7.1 (line 4)
GET ...colorbox_default_style.js?mkc9hs&_=1364428695069 200 OK jquery...v=1.7.1 (line 4)
TypeError: $(...).filter(...).once(...).colorbox is not a function
[Break On This Error]
.colorbox(settings.colorbox);| Comment | File | Size | Author |
|---|---|---|---|
| #6 | jquery_update-fix_ajax_calls-1954930-6.patch | 1.42 KB | lucascaro |
| #4 | jquery_update-fix_ajax_calls-1954930-4.patch | 1.74 KB | lucascaro |
Comments
Comment #1
lucascaro commentedDebugging this I realized that when doing an ajax call from the backend, jquery_update has no way to know and attempts to load the frontend version of jquery, causing an error and breaking ajax calls.
current_paths for ajax calls might not be marked as admin paths, but they need to use the same jquery version as the original page.
Comment #2
lucascaro commentedThis might be related to #1957782: ['ajax_page_state']['jquery_version'] not sent back to the server
Comment #3
lucascaro commentedI've found an error on jquery_update.module:207
The if clause is using a undefined variable, it should be using $ajax_version instead.
I also had to add the following script to make it work (inspired on http://drupal.org/node/1957782):
With these two changes it's working on my end. Ill post a patch ASAP.
Comment #4
lucascaro commentedHere's the patch:
Comment #5
Punk_UnDeaDdon't use drupal_add_js
it fix for drupal.ajax library, not an independent file
use something like
Comment #6
lucascaro commentedre-roll with the change from #5
Comment #7
ericduran commentedHmm, The beforeSerialize shouldn't be require. That is why I added the POST check.
How is the Ajax request being made? If the ajax request is properly being done using Drupal Ajax system the post value should be there.
I'm going to need to test this before this patch can be added.
Comment #8
Punk_UnDeaDnot all data collect to send
only ajax_html_ids, ajax_page_state[theme], ajax_page_state[theme_token], ajax_page_state[css] and ajax_page_state[js]
see Drupal.ajax.prototype.beforeSerialize
Comment #9
ericduran commented@Punk_UnDeaD Ahh, It's because I only tested with ajax forms which does return the entire Drupal.settings.
Reviewing the patch now.
Thanks.
Comment #10
ericduran commentedWe should actually change the weight to go right after the ajax script.
Lets not leave the weight the same to make it clear that we want that specific order.
The rest looks good.
Thanks all.
Comment #11
ericduran commentedI made some changes. I made sure our ajax fix is only on the drupal ajax js and made sure it's always after it.
This is now fixed.
Thanks.
--
http://drupalcode.org/project/jquery_update.git/commit/7b66e73