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.
After running update.php, I ran into the problem that the CDN theme was not loaded anymore. I cleared cache houndreds of times, restarted Apache, ran cron, rebuild theme registry, disabled/re-enabled jQuery Update, updated Bootstrap theme to latest dev... but jsDelivr options didn't return.
Did the mechanism for retrieving the jsDelivr option change?
I reproduced on another site with the same steps: run update.php, then go the to theme setting.
Bootstrap theme: latest dev, jquery set to 1.9 standard, 1.7 for administration
Comment | File | Size | Author |
---|---|---|---|
#6 | bootstrap_jsdelivr_cdn-2504343-6.patch | 611 bytes | m.stenta |
#1 | jsDelivr-no-options.jpg | 65.6 KB | Daniel Schaefer |
Comments
Comment #1
Daniel Schaefer CreditAttribution: Daniel Schaefer commentedComment #2
dozer55 CreditAttribution: dozer55 commentedI can confirm the same behavior.
Comment #3
m.stentaConfirmed, same issue here.
Comment #4
m.stentaThis is actually an issue in the current dev branch.
Comment #5
kumkum29 CreditAttribution: kumkum29 commentedSame problem for me...
Comment #6
m.stentaThe problem is that jsDelivr started calling Bootstrap "twitter-bootstrap" instead of "bootstrap".
Patch attached.
Comment #7
dunlop CreditAttribution: dunlop commentedSame problem for me.
Temporary workaround is to use another CDN Provider set under Custom:
Change 3.3.4 in above to your preferred version.
I can confirm that using this CDN does work for me.
Comment #8
dunlop CreditAttribution: dunlop commentedPatch in #6 works for me. No need for the workaround I gave.
Comment #9
amorsent CreditAttribution: amorsent commentedFYI - If you've saved your theme settings while it was broken, you may also need to go back and correct the cdn settings after applying the patch.
Comment #10
Daniel Schaefer CreditAttribution: Daniel Schaefer commentedJust applied the patch on both sites and it works well. Thank you m.stenta for your help!
I will set this to RTBC so we can commit quickly.
Comment #11
markhalliwellThis happened due to a regression introduced in jsDelivr's API v1 (likely due to work on v2). I have filed an issue with them: https://github.com/jsdelivr/api/issues/94
The real "problem" is that the "bootstrap" alias (provided by BootstrapCDN) is no longer being picked up (by jsDelivr API v1). "twitter-bootstrap" has always existed.
I'm tempted to mark this as "Closed (won't fix)" or "Closed (works as designed)" and just wait for them to fix their mistake (and to wait for v2), but this is a relatively minor change. I will commit shortly.
Comment #14
markhalliwellComment #15
markhalliwellFWIW, the "bootstrap" alias has been fixed and is back in v1: http://api.jsdelivr.com/v1/bootstrap/libraries?name=bootstrap
Comment #16
m.stenta@markcarver: Thanks for the quick response!
Unfortunately, the commit you made does not work.
Take a look at line 169:
And here it is in context:
With your change, that line of code will be trying to set a variable named $twitter-bootstrap, but it needs to be setting the $bootstrap variable. I tried your change first, and ran into that issue, which is why I ultimately just added a line to translate "twitter-bootstrap" into "bootstrap" instead (minimally invasive, but sticking with the existing conventions in the code).
Changing this back to Needs Work.
Comment #19
markhalliwell@m.stenta, you are correct. Might have helped if I had actually tested the change before committing, my bad.
dynamic variables--
I've opted for using a
$libraries
array instead to get rid of the dynamic variable bit (I knew this would come back to bite me in the a$$) and then re-purposed the$bootstrap
and$bootswatch
variables to be the expected jsDelivr library names.Comment #20
markhalliwellAlso I feel like I should have further explained why I chose to not use the patch in #6.
Arbitrarily changing a raw response value is never really a good idea and is generally considered bad "best practice". It can lead to hours of confusion as to "why" or "where" this change occurred (as it would differ from the original API response). Also, I knew they would likely put it back in (which they did, rather quickly) and thus we would have duplicate libraries on our hands.
Comment #21
m.stenta@markcarver: You're right. I shouldn't have been changing a raw response value... bad. Oh well, glad you got a new fix worked out!
And yea... dynamic variables are definitely another one of those someday-gotchas. :-)
Thanks again!
Comment #24
markhalliwellNo worries. This actually has helped with the "what happens when" scenario.
I've gone ahead and committed more fixes so that it moves the "error" handling up a little when the main
twitter-bootstrap
library isn't found whether it be from bad HTTP request or something like this (where the request was successful, but the library name didn't exist in the response).Comment #26
ytsurkGOSH - they changed it back to bootstrap ...
I made this new issue:
#2842944: jsDeliver name change back to bootstrap