After updating to 1.16, I'm getting this JS error:

Uncaught TypeError: $.cookie is not a function
    at Function.Drupal.eu_cookie_compliance.getCookieStatus (eu_cookie_compliance.js?v=1.9:558)
    at Function.Drupal.eu_cookie_compliance.getCurrentStatus (eu_cookie_compliance.js?v=1.9:571)
    at HTMLBodyElement.<anonymous> (eu_cookie_compliance.js?v=1.9:24)
    at Function.each (jquery.min.js?v=3.6.0:2)
    at S.fn.init.each (jquery.min.js?v=3.6.0:2)
    at Object.attach (eu_cookie_compliance.js?v=1.9:21)
    at drupal.js?v=9.2.6:27
    at Array.forEach (<anonymous>)
    at Object.Drupal.attachBehaviors (drupal.js?v=9.2.6:24)
    at drupal.init.js?v=9.2.6:29

Including the deprecated "core/jquery.cookie" instead of "core/js-cookie" fixes the problem for me. This is however only a workaround, as the latter one should be used

Comments

agoradesign created an issue. See original summary.

agoradesign’s picture

Version: 2.0.x-dev » 8.x-1.x-dev
jckresko’s picture

I reproduced the issue, but clearing the browser caches and stored cookies , the error disappear.

trigoda’s picture

Hello,

i have the same issue and clearing Cookies, Browser-Cache and even all Drupal Caches did not resolve it...

Still there is: " Uncaught TypeError: e.cookie is not a function" in the console

This happens on 2 different drupal 9 installations here.

Kind Regards

agoradesign’s picture

Status: Active » Closed (cannot reproduce)

sorry for the noise, Although clearing Drupal cache mutliple times and pressing CTRL + F5, the browser seems to haven't really reloaded the file. I have checked the module's source code, as well as have retried with cleared cache. This definitely works as expected! @trigoda it must be the same issue for you, as the failing code is definitely not part of the module's JS anymore!

agoradesign’s picture

Status: Closed (cannot reproduce) » Active

I need to re-open that and I've already found the problem!

in libraries.yml the versions are hardcoded to '1.9'. You have to either raise the number or write 'VERSION' instead like many other modules do. I guess that gets replaced correctly by Drupal then

agoradesign’s picture

Status: Active » Needs review
StatusFileSize
new945 bytes
yazzbe’s picture

manual applied patch #7.
it fixed the problem for me.

thanks!

svenryen’s picture

Thanks. Yes, as you've spotted we forgot to bump the version number of the library. I wasn't aware that we could use "VERSION", that's really helpful.

Next time you contribute, can I suggest a GitLab branch rather than a patch?

  • svenryen committed d73decb on 8.x-1.x authored by agoradesign
    Issue #3239361 by agoradesign, jckresko, trigoda, yazzbe, svenryen: "...
svenryen’s picture

Status: Needs review » Fixed
agoradesign’s picture

oh sorry. yes of course. I needed that as emergency patch immediately yesterday. So I included the patch locally first, then commented and uploaded the patch here. therefore the oldschool patch

trigoda’s picture

That helped me, problems are gone, thank you very much! @agoradesign @svenryen

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

miiimooo’s picture

@svenryen This is not fixed. I don't understand why but the patch/commit is not in the current stable 1.19 (or the master branch)

See https://git.drupalcode.org/project/eu-cookie-compliance/-/blob/8.x-1.x/e... etc or https://git.drupalcode.org/project/eu-cookie-compliance/-/blob/8.x-1.19/... for instance

Even though I can see the commit here https://git.drupalcode.org/project/eu-cookie-compliance/-/commit/d73decb !!!

agoradesign’s picture

svenryen’s picture

Status: Closed (fixed) » Active
superbiche’s picture

svenryen’s picture

Status: Active » Needs review

  • svenryen committed d23b0d4 on 8.x-1.x authored by superbiche
    Issue #3239361 by agoradesign, superbiche, svenryen, jckresko, miiimooo...
svenryen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

nelo_drup’s picture

Hello, I am reopening the topic to avoid generating duplicates and to inform that none of the patches are compatible with Drupal 10 or later.

drupal_developer2022’s picture

Hello @Nelo_Drup,
I have the same problem in Drupal 10 like you. Did you find a solution for this?

nelo_drup’s picture

@drupal_developer2022 Hello, if you try to repair it manually, it can be solved.