Cookiebot Declaration shows op in each views row when Node page title not set.

Created on 16 May 2019, over 5 years ago
Updated 1 February 2023, almost 2 years ago

Hi I create this issue for other people facing this problem/mistake. I think a solution in code is possible but I just didn't read the cookiebot settings well enough.

What's the problem:

The cookiebot declaration shows up in each views row in a view with nodes.
Or when you'r domain isn't configured the generated message shows up for each row:
The domain YOURDOMAIN.COM is not authorized to show the cookie declaration. Please add it in the cookie manager to authorize the domain.

Quick Solution:

Make sure you're cookiebot settings configuration is one of the following:
- check 'Show the Cookiebot cookie declaration" and fill in the "Node page title"
- don't check and don't fill in

How is it caused:

- In the cookiebot settings mark the checkbox 'Show the Cookiebot cookie declaration'
- But don't fill in the 'Node page title' field.
- create a drupal view with nodes.

What's happening:

In cookiebot_node_view_alter() the cookiebot declaration is added to the node that should be configured in the cookiebot settings. But when the node isn't configured the $declaration_node_path is "/node/". At the same time, we are in a node while not on a node path (we are on a view) so $current_alias is also "/node/".
That means that for each viewsrow with a node the comparison $current_alias === $declaration_node_path will be TRUE and the cookiebot declaration will be inserted.

Suggestions to solve this in code

- adding a check in the form validation
- in cookiebot_node_view_alter test if it's really a node page and not another page, like a view.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands Floris Vedder

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024