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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

woldtwerk created an issue. See original summary.

woldtwerk’s picture

Issue summary: View changes
sarwan_verma’s picture

Status: Active » Needs review
StatusFileSize
new2.21 KB

Hi,

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

abhiyanshu’s picture

Status: Needs review » Needs work

The suggested resolution is that the $typedConfigManager variable needs to be typed.
However, in the attached patch #3, I see this patch removes the TypedConfigManagerInterface entirely, which does not resolve the typing error and conflicts with the requirement for the $typedConfigManager property to be typed as TypedConfigManagerInterface.

And also the service ID 'config.typed' is not appropriate for Drupal 11. Instead it should be 'config.typed_config_manager'.

abhiyanshu’s picture

Status: Needs work » Needs review
StatusFileSize
new1.88 KB

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.

woldtwerk’s picture

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