Drupal 11 incompatibility in ConfigFormBase

Created on 23 January 2025, 1 day ago

Problem/Motivation

After installing the drimage improved module an a Drupal site with version 11.1.1 and visiting the settings form on /admin/config/media/drimage_improved I got fatal PHP error.

In the latest Drupal 11 version the ConfigFormBase class expects the second argument to be of type TypedConfigManagerInterface. But the DrimageSettingsForm class, which extends from the ConfigFormBase class, does not pass that argument in the parent::__contructor.
The full error message:
NOTICE: PHP message: Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/drimage_improved/src/Form/DrimageSettingsForm.php on line 62 and exactly 2 expected" at /var/www/html/web/core/lib/Drupal/Core/Form/ConfigFormBase.php line 44

Steps to reproduce

  • Install a new Drupal with version 11.1.1
  • install and enable the drimage_improved module
  • visit the settings page on: /admin/config/media/drimage_improved

Proposed resolution

Pass the TypedConfigManagerInterface to the parent::__construct in the constructor of the DrimageSettingsForm class.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium wannesdr Belgium 🇧🇪

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

Comments & Activities

Production build 0.71.5 2024