Problem/Motivation

The option "optOut" is used for scripts which should be loaded, but a later opt-out can be done. Scripts marked as "optOut" will not be loaded.

Steps to reproduce

- Include a script and use or create a Klaro! service
- Set Klaro! Service option "optOut" to true
- Load page and see that script is not loaded.

Proposed resolution

Fix the bug.

Issue fork klaro-3504281

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jan kellermann created an issue. See original summary.

jan kellermann’s picture

Status: Active » Needs review

I added applyConsents() while initialization.

Please review and feedback.

jan kellermann’s picture

Bump. Updated fork, ready to review. Would be great to have this issue reviewed and merged for next release.

jan kellermann’s picture

Assigned: jan kellermann » Unassigned
sascha_meissner’s picture

I reviewed this issue with the following result:

I can reproduce the issue and solve it by just setting "Toggled by default" as well.

The codechange in drupal.js is unnecessary and just leads to execute the script twice on load.
I´ll update the MR accordingly.

sascha_meissner’s picture

Status: Needs review » Needs work

After looking again over this together with Jan Kellermann

We found out that it does not work for elements with contextual consent elements, the ressource gets loaded but the contextual element is still shown.
So i´m setting this back to needs work ...!

For scripts without contextual consent, setting "Toggled by default" to true should solve the issue

sascha_meissner’s picture

FYI: I just tested the vanilla library and have the same result, the contextual element is shown instead of the resource
Created an upstream issue https://github.com/klaro-org/klaro-js/issues/536

jan kellermann’s picture

This is fixed in https://github.com/klaro-org/klaro-js/issues/536

We are considering to update drupal/klaro-js.

jan kellermann’s picture

nno’s picture

For scripts without contextual consent, setting "Toggled by default" to true should solve the issue

I don't think this works too. If both "Toggled by default" and "Opt out" are selected it seams that there is no way to opt-out. Services are loaded even if manually disabled under Customize and also if Decline is clicked.

anybody’s picture

anybody’s picture

Version: 3.0.0 » 3.x-dev
Priority: Critical » Normal

Additionally to the textual change here, we could also use Drupal Form States API to force the Toggled by default checkbox to be enabled for better UX. What do you think @jan kellermann?

jan kellermann’s picture

Version: 3.x-dev » 3.1.x-dev

We released klaro_js 3.1.0 and created a new branch 3.1.x for klaro with the constraint to klaro_js ~3.1.0.

We merged this to klaro 3.1.x

Please test klaro 3.1.x-dev or a current RC for 3.1.x.

jan kellermann’s picture

Priority: Normal » Major
Status: Needs work » Needs review