ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct()

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

Problem/Motivation

When the module is installed on a fresh Drupal 11 is it throwing an ArgumentCountError error on the Cookiebot settings page. The error is:

ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/cookiebot/src/Form/CookiebotForm.php on line 52 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 43 of /var/www/html/web/core/lib/Drupal/Core/Form/ConfigFormBase.php).

The reason for this error is a change in the configFormBase construct from Drupal 10 to 11, see https://git.drupalcode.org/project/drupal/-/commit/5e81fb10eb58017ad8ce8....

Steps to reproduce

Install the Cookiebot module on Drupal 11 and navigate to admin/config/cookiebot.

Proposed resolution

Change the CookiebotForm class to be compliant with the core changes to configFormBase.

🐛 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