Warning when visiting settings form

Created on 15 December 2023, 11 months ago
Updated 22 July 2024, 4 months ago

Problem/Motivation

I was running some functional tests on a blank DB and one was failing due to the following warning:
Warning: foreach() argument must be of type array|object, null given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of /var/www/html/www/core/lib/Drupal/Core/Render/Element/Checkboxes.php)
This was due to some of the settings not having values in the datalayer settings form.

Proposed resolution

Type cast the values that are retrieved for the checkboxes as arrays to avoid this warning.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇬🇧United Kingdom kristiantosney

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