Checkboxs default value must be array

Created on 1 September 2025, about 1 month ago

Problem/Motivation

After installing the module and going to /admin/config/content/content-notify I see:

Warning: foreach() argument must be of type array|object, null given in /var/www/html/docroot/core/lib/Drupal/Core/Render/Element/Checkboxes.php on line 117

Warning: foreach() argument must be of type array|object, null given in /var/www/html/docroot/core/lib/Drupal/Core/Render/Element/Checkboxes.php on line 117
The website encountered an unexpected error. Try again later.

TypeError: array_merge(): Argument #1 must be of type array, null given in array_merge() (line 399 of modules/contrib/content_notify/content_notify.module). 

Steps to reproduce

Install module.
Go to /admin/config/content/content-notify
See the error.

Proposed resolution

If config is not set pass an empty array as default value.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom dahousecat

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

Comments & Activities

Production build 0.71.5 2024