Improve Reject Option and Opt-In/Opt-Out Behavior

Created on 17 October 2024, 6 months ago

Problem/Motivation

Currently, the Reject option in the EU Cookie Compliance module does not disable all cookie categories, including those marked as disabled. Additionally, the behavior of opt-in and opt-out functionality can be improved to ensure a more consistent user experience.

Steps to reproduce

  1. Install the module EU Cookie Compliance (8.x-1.25).
  2. Configure the module with different cookie categories, including some marked as disabled by default.
  3. Use the Reject option in the cookie compliance banner.
  4. Observe that not all categories, including disabled ones, are unchecked.

Proposed resolution

  • Update the JS logic to ensure that the Reject option disables all categories, even those marked as disabled.
  • Improve handling of checkboxes for opt-in and opt-out categories based on the current user's cookie consent status.
  • Ensure that the default state of checkboxes is correctly set and applied when a user selects Agree or Reject.

Remaining tasks

  • Review the attached patch.
  • Test the solution in multiple scenarios (default consent, no consent, withdrawn consent).
  • Ensure the UI properly reflects the cookie choices after the changes.
  • Verify backward compatibility.

User interface changes

None expected, as this change mostly affects the behavior of the checkboxes and consent categories.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Active

Version

1.25

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine vo_dev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @vo_dev
  • πŸ‡ΊπŸ‡¦Ukraine vo_dev

    I've attached a patch that addresses the issue

    Please review and test the patch to confirm the improvements. Any feedback would be appreciated!

  • πŸ‡³πŸ‡±Netherlands Summit

    Hi, Great patch for latest version 8.x-1.25, and preferabel migrated in this module? Is this possible?
    greetings,

  • πŸ‡ΊπŸ‡¦Ukraine vo_dev
  • πŸ‡³πŸ‡ΏNew Zealand atowl

    Hi vo_dev,

    Thanks for the patch, tried to apply this to 8.x-1.x, but wouldn't apply cleanly. The issue is mainly in the libraries.yml file. Since you are modifying the JS, you'll need to minimize it as well. If you haven't already, try the issue fork, much easier than patches.

    I am also not entirely convinced that when pressing Reject All, should clear the "Checked and disabled" boxes, as these would be those options regarded as necessary for the site to operate?

Production build 0.71.5 2024