Problem/Motivation

Sometimes, we need to be able to disable the Automatic Cookies Removal (but we can still be GDPR compliant).
To do so, for now we have to fill-up the whitelisted_cookies field, but sometimes we can't as the cookies are randomly generated.

Proposed resolution

Having a new checkbox which allows enabling or disabling the Automatic Cookies Removal.

To prevent any regression on production project, I would suggest checking this option by default.
By doing this we will ensure the same behaviour as now.

Remaining tasks

- reviews needed

User interface changes

A new Checkbox appears on the Backend with the following label "Enable cookie(s) automatic-removal when consent isn't given."

Comments

wengerk created an issue. See original summary.

wengerk’s picture

Status: Needs work » Needs review
StatusFileSize
new5.79 KB

Here is a first draft, let's tests it by Testbot.
And many thanks for your review and help !

Status: Needs review » Needs work

The last submitted patch, 2: 3083955-02.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

wengerk’s picture

Status: Needs work » Needs review
StatusFileSize
new626 bytes
new5.79 KB

Fix a tiny code quality flaws I introduce

  • src/Form/EuCookieComplianceConfigForm.php
    • 320 Avoid backslash escaping in translatable strings when possible, use "" quotes instead

The 2 others flaws have not been introduce by my patch, it would be out-of-scoop to fix them here.

Status: Needs review » Needs work

The last submitted patch, 4: 3083955-03.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

wengerk’s picture

Status: Needs work » Needs review
anybody’s picture

I guess this should be discussed in detail. If this option is once in, it will be hard to be removed or altered!

Candidate for 8.x-2.x! #3130662: Roadmap to 2.0.x release

aerzas’s picture

Since the latest release, the `eu_cookie_compliance_update_8115` function is declared and the proposed patch creates a duplicated function. Here is quick update of the patch expected version.

kimberleycgm’s picture

Status: Needs review » Reviewed & tested by the community

I had been working on a very similar implementation (https://www.drupal.org/project/eu_cookie_compliance/issues/3153194) for this problem and hadn't seen this issue at the time.

I've switched out my patch for this one on my site and it's working as expected. I did have an issue in one of my sessions with cookies being cleared out still, but I don't think it was related to this. A new incognito session logged out and logged in worked well.

I've now closed the other issue as a duplicate of this.

kimberleycgm’s picture

Status: Reviewed & tested by the community » Needs review

One query though - on this line 'automatic_cookies_removal' => !empty($config->get('automatic_cookies_removal')) ? $config->get('automatic_cookies_removal') : FALSE, would it be better to set the fallback value to TRUE instead (as that's the current behaviour)? And do a check on the data being set, rather than empty?

svenryen’s picture

Status: Needs review » Reviewed & tested by the community

One query though - on this line 'automatic_cookies_removal' => !empty($config->get('automatic_cookies_removal')) ? $config->get('automatic_cookies_removal') : FALSE, would it be better to set the fallback value to TRUE instead (as that's the current behaviour)? And do a check on the data being set, rather than empty?

Agreed. I made this change and tested the patch. Works great! Thanks for the contribution!

svenryen’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new5.65 KB

Here's the updated patch.

  • svenryen authored eedd5f2 on 8.x-1.x
    Issue #3083955 by wengerk, Aerzas, svenryen, kimberleycgm, Anybody:...

Status: Fixed » Closed (fixed)

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

anybody’s picture