Error: Call to a member function toString() on null in cookiebot_preprocess_menu()

Created on 19 August 2024, 5 months ago
Updated 3 September 2024, 4 months ago

Problem/Motivation

The module throws a

Error: Call to a member function toString() on null i cookiebot_preprocess_menu() (linje 205 af /var/www/html/web/modules/contrib/cookiebot/cookiebot.module)

in both Drupal 10.3 and Drupal 11 when the new experimental navigation module is enabled.

Steps to reproduce

Enable both the Cookiebot and the core Navigation module.

Proposed resolution

Add a condition checking that $item['url'] is not empty before accessing $item['url']->toString().

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇰Denmark beltofte Copenhagen 🇩🇰

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024