Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When hovering links in the Views UI with 1.8 enabled, I get this error:
Uncaught Error: Syntax error, unrecognized expression: #views-display-menu-tabs.not(.views-ui-render-add-view-button-processed-processed) li.add
which in turn breaks the modals in Views so the UI becomes useless. Going back to 1.7 works around the problem.
Comment | File | Size | Author |
---|---|---|---|
#24 | 1802198.patch | 961 bytes | drumm |
#19 | views-ui_break_with_jq1.8-1802198-19.patch | 1.08 KB | hswong3i |
#5 | views-update_to_jquery_18-1802198-6689452.patch | 831 bytes | westwesterson |
Comments
Comment #1
markhalliwellMight have to do with 1.8's new Sizzle selectors. I tried finding the JS in Views to see if some code needed to be reworked, but didn't find anything. Per this issue #1494860: Views Rewrite Results UI Broken using JQuery 1.7 perhaps the issue lies with CTools?
Comment #2
Lux Delux CreditAttribution: Lux Delux commentedWell in the previous dev release, with just replacing the version numbers (inside the module's google cdn path settings) to the latest jquery and jquery ui, everything worked fine. So might be a clue somewhere in that?
Comment #3
michaelgc CreditAttribution: michaelgc commentedI'm also getting this error, even after I forced the .module file to use jQuery UI 1.8.23 instead of 1.8.11, and cleared all site/view caches. Could be CTools-related.
Comment #4
LobsterJonn CreditAttribution: LobsterJonn commentedI found a fix that worked for me.
in views/js/views-admin.js line 261 replace
$('li.add', $menu)
with
$($menu.get(0)).find('li.add')
There might be better ways to do it, but I don't have the time to do more about it now.
The problem seems to be an incompatibility with jQuery.once and the new Sizzle (just speculating because I know nothing of it)
Changing the version number for jQuery UI fixed another problem for me in Views UI regarding the function curCSS.
Comment #5
westwesterson CreditAttribution: westwesterson commentedI created a patch for the views module including changes by lobsterJonn.
Can someone test to see if after this change views still works with default drupal 7 jquery version? If it does maybe we can push this change to the views issue queue.
Comment #6
jghyde CreditAttribution: jghyde commentedI just tested this. manually patched to the green prod version of views. The modal windows are still horked and the console says:
jQuery Update to 1.8.2
Comment #7
westwesterson CreditAttribution: westwesterson commentedI've tested this more since I posted the patch. Does not fully work with jQuery 1.8. It appears the JSON being returned is not being parsed.
Comment #8
mrded CreditAttribution: mrded commentedI got same error on dev version of module.
Comment #9
airstarh CreditAttribution: airstarh commentedThe same
Comment #10
zmove CreditAttribution: zmove commentedSame, views UI is broken ith jquery 1.7 or 1.8, for example when you check a checkbox, it does not display additionnal options.
The dev version become quite old, is it still maintained ?
Comment #11
DriesP CreditAttribution: DriesP commentedSame problem....
Comment #12
bastnic CreditAttribution: bastnic commentedYou should look at http://drupal.org/node/1766240#comment-6763650
Comment #13
kmontyMoving this issue to Views, as this isn't an issue with the jquery_update project's code.
Comment #14
vinoth.3v CreditAttribution: vinoth.3v commentedAny update?
I am getting plain ajax response displayed in browser when submitting form in Views admin UI
Comment #15
maxilein CreditAttribution: maxilein commentedme too. :-( Same with jQuery 1.7.
Had to revert to 1.5 ...
Comment #16
dawehnerhttp://drupal.org/node/1802198#comment-6915294 seems to be an okay workaround. You could even use admin/structure/views as path to be more detailed.
Comment #17
smk-ka CreditAttribution: smk-ka commentedPlease be aware that in order to fix this bug you'll need to also apply #1847900: Update jQuery UI to 1.8.24, since the version of jQuery UI shipped with the jQuery Update module is incompatible with jQuery. If you apply both, it should work fine.
Comment #18
vinoth.3v CreditAttribution: vinoth.3v commented@smk-ka
Thank you
Comment #19
hswong3i CreditAttribution: hswong3i commentedDouble confirm with latest jquery_update in 1.8 + UI patch for 1.10 + views 7.x-3.x-dev, apply patch from #5 can solve the error message which figure out from Firebug.
Patch recreate by following commands:
Comment #20
dawehnerDid you tested it also without jquery 1.8?
Comment #21
hswong3i CreditAttribution: hswong3i commentedTested with jquery_update disabled, no error reported from Firebug ;-)
Comment #22
eclecto CreditAttribution: eclecto commentedThe latest dev version of jQuery Update has a workaround for issues like this, allowing you to choose a different version of jQuery for admin pages than for your frontend.
It doesn't solve the problem, per se, but it could save you from having to patch Views until there's a new commit.
Comment #23
markhalliwellI know jquery_update put in a solution for this, which does temporarily "fix" this problem. But ultimately I don't want to have to choose an outdated version of jQuery for admin just because it breaks Views. Views needs to be patched to work with jQuery 1.8.
Comment #24
drumm.live()
is deprecated in jQuery 1.8, so we should go ahead and replace it with.delegate()
, which was added in jQuery 1.4.2. Drupal 7.21 has jQuery 1.4.4.I've tested the attached patch with jQuery 1.8.2, as installed by jquery_update. As far as I know, what to test for is
Comment #25
drummComment #26
drumm(Adding a couple tags since we ran into this on the portland2013.drupal.org. I've deployed #24 there, see #1946282: Admin view of DrupalCon Portland being horribly buggy and disobedient .)
Comment #27
dawehnerI still try to figure out why jquery changes it's APIs so often :)
Delegate is a really nice way to solve it! Thanks.
Committed and pushed to 7.x-3.x
Comment #29
robertgarrigos CreditAttribution: robertgarrigos commentedI'm having this error with views 7.3.7, and dev also, six months later with jQuery 1.8. Modal windows keep braking.
Comment #30
drummI am not actively working on this.
Comment #31
dawehnerSeriously someone should port the views JS and bring it into the jquery update module project. Contrib code also can't deal with php 6 yet.
Comment #32
idebr CreditAttribution: idebr commentedIn the latest jquery_update dev release, there is an option to use an older version of jQuery for administrative pages. Relevant issue: #1524944: Allow different version for administrative pages
Comment #33
deryck.henson CreditAttribution: deryck.henson commentedFixing it:
Set the source in jQuery Update settings to ANYTHING except the jQuery CDN. No matter the combo, jQuery CDN is refusing to load anything but UI 1.8.2. Once the source is changed (to Google, Microsoft or even NONE - both compressed and full sources), jQueryUI 1.10.2 is loaded, even if jQuery < 1.10 is selected.
Now everything works as expected, with jQuery 1.7, 1.8, 1.9 and 1.10.
Contrary to what #13 claims, this was actually a jQuery Update issue (seen here), not Views. However, since Views seems to be the most affected (because it's also the most used) module, I'm not moving it so others can see it here.