Error when config is empty

Created on 26 May 2025, 11 days ago

Problem/Motivation

If I install the module then browse to the config form I get this error:

TypeError:
implode(): Argument #1 ($pieces) must be of type array, string given

  at modules/contrib/cookie_bot_protection/src/Form/SettingsForm.php:50
  at implode('', null)
     (modules/contrib/cookie_bot_protection/src/Form/SettingsForm.php:50)
  at Drupal\cookie_bot_protection\Form\SettingsForm->buildForm(array('#attributes' => array('class' => array('cookie-bot-protection-configuration-form'))), object(FormState))

Steps to reproduce

Install the module then browse to /admin/config/cookie_bot_protection/settings.

Proposed resolution

I see two ways to fix this:

  • Adapt the code to work when this config does not exist yet.
  • Add default config to the module (in the config/install/ folder).

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France prudloff Lille

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