I noticed that core/jquery.cookie is referencing the jquery-cookie v1.4.1 library that is now no longer maintained. It is being superseded by js-cookie and so I would like to write a Drupal core patch so that others can also have this feature.

The problem I am having is that I do not know how to properly apply a patch for something like this. I assume that I would have to modify the core.libraries.yml file to include the latest js-cookie, then I would have to include the minified JavaScript file into the assets/vendor directory such that the file is located in assets/vendor/jquery.jscookie/js.cookie.js while defining the library.

How would I download the js.cookie.js file into the assets/vendors/jquery.jscookie directory when I define the jquery.jscookie library?

My goal is to leave the existing jquery.cookie library so this patch would just need to define the library and add its js file into the appropriate directory.

  • 2
    I'd suggest opening an issue in the Drupal issue queue first. Get some input on it before writing a patch. – Jaypan Mar 21 at 0:12
  • 1
    Thank you for your interest. I would encourage you to join Drupal Slack and join the #contribute and #javascript channels. There are many core sub-system maintainers there that would be happy to answer questions. Additionally, what I did to look this up was to use git blame and then search for other similar issues such as drupal.org/node/289914, which should show you a good example of how that sort of issues flows. Most likely this issue would be more complex so asking in Slack about it would help. – mradcliffe Mar 21 at 11:44
  • 1
    @usernameabc, drupal.org/project/drupal/issues/3042182, this issue seems pretty relevant. – mradcliffe Mar 22 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.