I didn't want to downgrade jQuery on ALL admin paths just because I had one that I knew needed the downgrade.

So here is my proposed solution:

  1. Add another select beneath the "Alternate jQuery version for administrative pages" select, I call it "Alternate jQuery version for specific paths"
  2. If you select any jQuery version other than "Default", a textarea appears where you can specify path patterns where you want the selected jQuery version to be used

That is what this patch does. It uses the core function drupal_match_paths to match the patterns.

One thing that I like with this solution is that this is very declarative and straightforward regarding which paths this version will be used on.

I made it so that this very specific choice has the last word and overrides any other jQuery version choice made by the jQuery update module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emattias’s picture

Status: Active » Needs review
FileSize
3.05 KB

Here's the patch that implements my solution.

emattias’s picture

Issue summary: View changes
emattias’s picture

Version: 7.x-2.4 » 7.x-2.x-dev
miccelito’s picture

Did try your patch but it seems that 'Default jQuery Version' value does override the 'Alternate jQuery version for specific paths' value.

For example with these settings:
Default jQuery Version: 1.8
Alternate jQuery version for administrative pages: Default (provided by Drupal)
Alternate jQuery version for specific paths value: Default (provided by Drupal)
Paths:
node/*/edit
node/add/*
jQuery and jQuery UI CDN: jQuery

But paths 'node/*/edit' and 'node/add/*' still use default jQuery version 1.8.

oushen’s picture

-

markhalliwell’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Needs review » Needs work

#1969244: Specify jQuery version per theme has been committed, this feature will need to work/detect after the theme jquery version is detected (if any).

markhalliwell’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#1539276: Introduce hook_jquery_version_alter()