TypedConfigManagerInterface

Created on 14 August 2024, 4 months ago
Updated 17 August 2024, 4 months ago

Problem/Motivation

PHP Fatal error: Type of Drupal\mercury_editor\Form\MenuSettingsForm::$typedConfigManager must be Drupal\Core\Config\TypedConfigManagerInterface (as in class Drupal\Core\Form\ConfigFormBase) in /home/woldtwerk/Repositories/woldtwerk/woldtwerk-saas/web/modules/contrib/mercury_editor/src/Form/MenuSettingsForm.php on line 16

Steps to reproduce

Install drupal 11 with mercury

Proposed resolution

The $typedConfigManager variable needs to be typed

See: https://www.drupal.org/project/drupal/issues/3394197 🐛 [regression] The new property \Drupal\Core\Form\ConfigFormBase::$typedConfigManager conflicts with some contrib modules Fixed

🐛 Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

🇩🇪Germany woldtwerk Stralibu

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

Merge Requests

Comments & Activities

  • Issue created by @woldtwerk
  • 🇩🇪Germany woldtwerk Stralibu
  • Status changed to Needs review 4 months ago
  • 🇮🇳India sarwan_verma

    Hi,

    I have fixed this issue "TypedConfigManagerInterface" and also attached patch,
    please review and verify,
    Thanks!.

  • Status changed to Needs work 4 months ago
  • 🇮🇳India abhiyanshu

    The suggested resolution is that the $typedConfigManager variable needs to be typed. However, in the attached patch #3, I see that the TypedConfigManagerInterface class is being removed, along with the entire $typedConfigManager variable. Instead of removing it, I think we should simply add:

    protected TypedConfigManagerInterface $typedConfigManager;
    

    This way, we maintain the necessary typing without removing the functionality.

  • Status changed to Needs review 4 months ago
  • 🇮🇳India abhiyanshu

    I have:

    • Added the TypedConfigManagerInterface import.
    • Added the TypedConfigManagerInterface type hint to the $typedConfigManager property.
    • Updated the create method to use the service ID 'config.typed_config_manager

    Thanks.

  • 🇩🇪Germany woldtwerk Stralibu

    The patches are not correct. It needs to be changed in 3 Files:
    src/Form/MenuSettingsForm.php
    src/Form/SettingsForm.php
    src/Form/SkipFormSettingsForm.php

    There already was an issue fork. No need for patches

Production build 0.71.5 2024