Check for user 1 fails because \Drupal::currentUser()->id() returns string

Created on 10 December 2021, over 3 years ago
Updated 20 November 2023, over 1 year ago

Problem/Motivation

Hi, the cookieconsent script would not load for user 1 despite the configuration being set to false. Seems to be related with \Drupal::currentUser()->id() returning a string at if (\Drupal::currentUser()->id() !== 1 && \Drupal::currentUser()->hasPermission('skip cookiebot consent')) { in cookiebot.module

Steps to reproduce

Proposed resolution

Force convert to integer

Remaining tasks

Review patch

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇧🇪Belgium leanderjcc Ghent

Live updates comments and jobs are added and updated live.
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