Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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:
- Add another select beneath the "Alternate jQuery version for administrative pages" select, I call it "Alternate jQuery version for specific paths"
- 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.
Comment | File | Size | Author |
---|
Comments
Comment #1
emattias CreditAttribution: emattias commentedHere's the patch that implements my solution.
Comment #2
emattias CreditAttribution: emattias commentedComment #3
emattias CreditAttribution: emattias commentedComment #4
miccelito CreditAttribution: miccelito commentedDid 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.
Comment #5
oushen CreditAttribution: oushen commented-
Comment #6
markhalliwell#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).
Comment #7
markhalliwell