One site I'm working on has a module that requires jquery_update but another module that breaks with jquery_update (and works fine with jquery that ships with core). Fortunately, the two modules do not coexist on the site, and it's only on the that I need jquery_update not to load. Would it be desirable (or encouraging a highly unstable site) to expose an admin option for paths on which to show/hide (replace/not replace) jquery?

For an immediate workaround specific to my need, I changed:
jquery_update.module:59:

  if (!empty($variables['scripts'])) {

to

  if (!empty($variables['scripts']) && ($variables['is_front'] != 1)) {

ftw.

CommentFileSizeAuthor
#5 jquery_exclude.patch1.5 KBMołot
#1 jquery-update-paths.png18 KBipwa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ipwa’s picture

Version: 6.x-2.0-alpha1 » 7.x-2.x-dev
FileSize
18 KB

A big +1 for this.

There are many issues that could be solved if this was implemented properly.

What I suggest is having a textfield that disables jquery update for certain paths, where we could use a wildcard.

For example if we disable jquery update for 'admin/*' a lot of the recent issues related to using 1.7 or higher could be solved and we could still use higher versions of jquery for our themes.

Attaching mockup:

ipwa’s picture

Title: jquery_update to expose option for "replace by path" or "don't replace by path"? » disable jquery update per paths

Changing title

ipwa’s picture

List of issues that could be temporarily solved with this:

I know this is not the ideal solution, but its a good short term solution while we find real solutions for the issues.

ipwa’s picture

Status: Active » Closed (works as designed)

Actually I think Jacine's patch in #1524944: Allow different version for administrative pages is the correct way to solve this.

Mołot’s picture

Status: Closed (works as designed) » Needs review
FileSize
1.5 KB

Jacine's patch is a good thing, but it is not designed for problems with conflict on the front theme, for example. And it will not help when I need new jquery on some pages, admin or not, and not for all.
Last but not least, linked issue is still alive, people have some significant problems using it.

Here is a patch to simply exclude module altogether where it's not needed, made against 7.x-2.3 but with context large enough to apply it manually.

ericduran’s picture

Status: Needs review » Postponed

I'm not really sure this patch is needed anymore.

I think most of the issues have been hammered out in the latest dev.

I'm going to postpone it and if enough people request it then we can revisit the issue. Sounds good?

Thanks.

Mołot’s picture

Good enough, I guess.

hass’s picture

I need Enable jquery update per paths to exclude it everywhere except on one node type add/edit form and the field type edit form. Nothing else. This may save a lot of headaches as jquery_update causes mostly a lot of bugs.

Mołot’s picture

hass, see my patch - only thing you need to do is to reverse condition and change a bit of wording.

aze2010’s picture

confirm: this patch works!

Please submit it!

Thank you very much!!!

FrancescoP’s picture

Issue summary: View changes

Thanks Mołot, you saved my day. :)

hass’s picture

That is not flexible as it does not support wildcards.

markhalliwell’s picture

There's really two components (issues) to this:

1) Provide a "disable" option
2) Provide a way to changed jQuery versions based on path.

I'm closing this as a duplicate of the following two related issues as they are both a separate feature.