After updating to 8.x-1.8, i receive the following error in the browser debug console, when i click the "OK, I agree" Button:

Uncaught ReferenceError: euCookieComplianceLoadScripts is not defined
at HTMLButtonElement.Drupal.eu_cookie_compliance.acceptAction (eu_cookie_compliance.js?v=1:302)
at HTMLButtonElement.dispatch (jquery.min.js?v=3.2.1:3)
at HTMLButtonElement.q.handle (jquery.min.js?v=3.2.1:3)

Comments

megadesk3000 created an issue. See original summary.

saschahannes’s picture

I have the same problem.

finabluma’s picture

same here :(

svenryen’s picture

Can you run drush cget eu_cookie_compliance.settings and paste the output here?

saschahannes’s picture

ush cget eu_cookie_compliance.settings"
cookie_lifetime: 100
domain: ''
domains_option: 1
domains_list: ''
eu_only: false
eu_only_js: false
exclude_paths: "/admin\r\n/admin/*\r\n/batch\r\n/node/add*\r\n/node/*/*\r\n/user/*/*"
exclude_admin_theme: false
langcode: de
popup_agreed:
  value: '<h2>Vielen Dank für das Akzeptieren der Cookies</h2><p>Sie können diese Meldung jetzt ausblenden oder mehr über Cookies erfahren.</p>'
  format: rich_text
popup_agree_button_message: 'Ok, ich bin einverstanden'
popup_agreed_enabled: false
popup_bg_hex: 1b4265
popup_clicking_confirmation: true
popup_scrolling_confirmation: false
popup_delay: 1
show_disagree_button: true
popup_disagree_button_message: 'Weitere Informationen'
popup_enabled: true
popup_find_more_button_message: 'Weitere Informationen'
popup_height: null
popup_hide_agreed: false
popup_hide_button_message: Ausblenden
popup_info:
  value: '<h2>Auf dieser Seite werden Cookies verwendet.</h2> Durch das Fortsetzen der Benutzung dieser Seite, stimmst du der Benutzung von Cookies zu.'
  format: rich_text
mobile_popup_info:
  value: '<h2>We use cookies on this site to enhance your user experience</h2><p>By tapping any link on this page you are giving your consent for us to set cookies.</p>'
  format: restricted_html
mobile_breakpoint: 768
popup_link: 'http://www.example.com'
popup_link_new_window: true
popup_position: false
fixed_top_position: true
popup_text_hex: ffffff
popup_width: 100%
use_bare_css: false
disagree_do_not_show_popup: false
reload_page: false
cookie_name: ''
exclude_uid_1: false
better_support_for_screen_readers: false
use_mobile_message: false
method: opt_in
disagree_button_label: 'Nein, danke'
disabled_javascripts: ''
whitelisted_cookies: ''
consent_storage_method: do_not_store
withdraw_message:
  value: '<h2>We use cookies on this site to enhance your user experience</h2><p>You have given your consent for us to set cookies.</p>'
  format: restricted_html
withdraw_action_button_label: 'Zustimmung zurückziehen'
withdraw_tab_button_label: Datenschutzeinstellungen
withdraw_enabled: false
_core:
  default_config_hash: m9leru0wVmD_yCnIJzIkZ9YhvEp3luuqLEx5Sr9CmRk
export:
  folder: custom
popup_info_template: new

svenryen’s picture

Thanks. I'll have a look tomorrow.

saschahannes’s picture

Okay, thank you for your quick response!

svenryen’s picture

Hi! I imported the config on 1.8, but can't reproduce. When I click "Ok, ich bin einverstanden", the banner disappears and I do not see any message in the console. Which browser are you using? I've tried Chrome, Firefox, Safari and even IE 11.

lobodakyrylo’s picture

I had the same issue. I used minifyjs module on my website and I minified eu_cookie_compliance.js so the website had the old version of the file.
I just re-minified eu_cookie_compliance.js file on the performance page and cleared cache and it started working.

heikkiy’s picture

The actual problem seems to be that the eu_cookie_compliance.libraries.yml still lists all the library versions as 1.0. If you had a previous version of the module installed, it loads the previous versions from Drupal cache. It keeps trying to find the old version from the cache at /modules/contrib/eu_cookie_compliance/js/eu_cookie_compliance.js?v=1.

Problem is solved if you edit eu_cookie_compliance.libraries.yml from the module directory and change all version 1.0 numbers to for example to 1.1. Clear Drupal caches after this. It should now load all the library files from /modules/contrib/eu_cookie_compliance/js/eu_cookie_compliance.js?v=1.1 and you should get a fresh working version.

heikkiy’s picture

StatusFileSize
new617 bytes

Attached is the problematic libraries file.

heikkiy’s picture

StatusFileSize
new713 bytes

Attached is a patch which increases the libraries version number to match the module.

anybody’s picture

Version: 8.x-1.8 » 8.x-1.x-dev
anybody’s picture

Status: Active » Reviewed & tested by the community

Patch #12 is ok. I would have thought clearing caches would also fix that kind of problem but #12 definitely won't break anything...

neslee canil pinto’s picture

+1, this looks like a fix.

svenryen’s picture

@HeikkiY and @Anybody
Does this imply that we need to bump the library version number every time we release a new version with an updated js file?

svenryen’s picture

Bumping the version numbers to 1.9 to match the current version.

  • svenryen authored 9405ea3 on 8.x-1.x
    Issue #3070307 by HeikkiY, svenryen, SaschaHannes, Anybody, megadesk3000...
svenryen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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