Problem/Motivation
When upgrading Drupal from 9 to 10, I get an JavaScript error that says "$.cookie is not a function". This is due to Drupal 10 not including the jquery.cookie library anymore (deprecated in Drupal 9). For more information, refer to the relevant change record.
Steps to reproduce
- Install and enable bootstrap_site_alert on Drupal 10 site.
- Open developer tools and notice the errors on the JS console.
Proposed resolution
Use js-cookie library instead of jquery.cookie.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | bootstrap_site_alert-replace-jquery-cookie-with-js-cookie-3383609-3.patch | 1.57 KB | mmenavas |
| jquery-cookie-error.png | 44.96 KB | mmenavas |
Comments
Comment #2
mmenavas commentedAttempt to fix this issue on 8.x-1.x branch.
Comment #3
mmenavas commentedPosting new patch as the pervious one wasn't working for me.
Comment #4
keshavv commentedComment #6
joseph.olstadfixed in the 8.x-1.x branch only
Comment #8
camslice commentedhi joseph.olstad, will you be released a new tag on the 8.x-1.x branch that includes this fix? the current tag 1.10.0 does not seem to include the fix.
currently my
composer.jsonlooks like this 🙃additionally, it seems that
dismissed-cookies.jsis throwing an error on line 14:cookiesis undefined... which can be fixed by providing a default value on line 2:thoughts?
Comment #9
joseph.olstadMy appologies @camslice.
https://www.drupal.org/project/bootstrap_site_alert/releases/8.x-1.12
Comment #10
joseph.olstadComment #11
joseph.olstadComment #12
joseph.olstadhttps://git.drupalcode.org/project/bootstrap_site_alert/-/commit/9531011...
Comment #13
camslice commentedThanks @joseph :)