Config form cannot be opened

Created on 29 June 2024, 5 months ago
Updated 13 July 2024, 4 months ago

Problem/Motivation

Config form shows the following error

The website encountered an unexpected error. Try again later.

TypeError: Drupal\Core\Form\ConfigFormBase::__construct(): Argument #1 ($config_factory) must be of type Drupal\Core\Config\ConfigFactoryInterface, null given, called in /var/www/html/web/modules/contrib/govuk_notify/src/Form/GovUKNotifyAdminForm.php on line 26 in Drupal\Core\Form\ConfigFormBase->__construct() (line 41 of core/lib/Drupal/Core/Form/ConfigFormBase.php).

Drupal\govuk_notify\Form\GovUKNotifyAdminForm->__construct() (Line: 33)
Drupal\govuk_notify\Form\GovUKNotifyAdminForm::create() (Line: 41)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)

Steps to reproduce

Log in and visit /admin/config/system/govuk_notify as an administrator.

Proposed resolution

Use the passed value to the constructor for the config factory rather than $this. Promoted properties aren't usable in the constructor (TIL!).

Remaining tasks

All the things.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

🇬🇧United Kingdom Eli-T Manchester

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