8.x-1.0-alpha6 made the module always insert the script for the auto blocking mode.

This breaks all existing sites using this module in manual mode (which was the only option so far).

I have made a patch making the blocking mode configurable.

Comments

arnested created an issue. See original summary.

arnested’s picture

Status: Active » Needs review
StatusFileSize
new2.6 KB
a.milkovsky’s picture

Status: Needs review » Needs work
+++ b/src/Form/CookiebotForm.php
@@ -101,6 +101,17 @@ class CookiebotForm extends ConfigFormBase {
+    $form['cookiebot_blocking_mode'] = [

Let's change this option to a checkbox:
Name: cookiebot_block_cookies
Title: Automatically block all cookies
Description: Defines if Cookiebot should automatically block all cookies until a user has consented.

arnested’s picture

Status: Needs work » Needs review
StatusFileSize
new2 KB

No problem. Let's do that. New patch attached.

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good, I think we can set this RTBC. Perhapts it would be nice to also add a link to the description of both functionalities in the cookiebot documentation!

anybody’s picture

arnested’s picture

StatusFileSize
new2.11 KB

Good idea, @Anybody. Link added.

anybody’s picture

RTBC!

After this has been committed, we should integrate it with #3091260: Blockmode "Auto" will not work in Drupal 8 with core's domready library.

a.milkovsky’s picture

+++ b/cookiebot.module
@@ -101,10 +101,16 @@ function cookiebot_page_attachments_alter(array &$page) {
+    $cookiebot['#attributes']['async'] = 'async';

I guess this is not necessary, right? Looks like we do not need async. I ca not find it in the cookiebot recommendations https://www.cookiebot.com/en/developer/.

  • a.milkovsky committed 9c2405f on 8.x-1.x authored by arnested
    Issue #3090518 by arnested, Anybody, a.milkovsky: Make blocking mode...
a.milkovsky’s picture

Committed, thank you for the contribution!
I will make a release for this issue.

P.S. Please let me know if you find the async flag necessary.

a.milkovsky’s picture

Status: Reviewed & tested by the community » Postponed
a.milkovsky’s picture

Status: Postponed » Fixed

Fixed

arnested’s picture

Issue summary: View changes
Status: Fixed » Needs review
StatusFileSize
new452 bytes

One of the points of not using the blocking-mode auto is that you can include the JavaScript in a non-blocking way, a.ka. async.

It's also in the documentation on https://www.cookiebot.com/en/manual-implementation/ (Step 3.1, see the example).

arnested’s picture

Version: 8.x-1.0-alpha6 » 8.x-1.0-alpha7
Issue summary: View changes
anybody’s picture

Status: Needs review » Fixed

@arnested please open a separate issue with the problem you experience in #14. The aim of this issue is solved.

a.milkovsky’s picture

One of the points of not using the blocking-mode auto is that you can include the JavaScript in a non-blocking way, a.ka. async.

Let's create a setting for this attribute as well.

@arnested please open a separate issue with the problem you experience in #14. The aim of this issue is solved.

agree

arnested’s picture

I created a new issue: #3097610.

Status: Fixed » Closed (fixed)

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