Problem/Motivation

I installed Migrate Wizard and dependencies through Composer. When I activated the module, the following error occurred:
PHP Fatal error: Type of Drupal\migrate_wizard\Form\BaseFormFields::$typedConfigManager must be Drupal\Core\Config\TypedConfigManagerInterface (as in class Drupal\Core\Form\ConfigFormBase) in /web/modules/contrib/migrate_wizard/src/Form/BaseFormFields.php on line 23
I tried via Drush or UI, but that doesn't matter. The module shows as enabled, but doesn't seem to work (no config pages)

Also any Drush action afterwards and some admin pages give the same error.

Environment details:
Drupal 11.1.1
PHP 8.3.11
MariaDB 10.11.6

CommentFileSizeAuthor
#5 After.mp413.4 MBsayan_k_dutta
#5 Before.mp42.72 MBsayan_k_dutta
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

dries arnolds created an issue. See original summary.

kul.pratap’s picture

Assigned: Unassigned » kul.pratap

kul.pratap’s picture

Assigned: kul.pratap » Unassigned
Status: Active » Needs review

When we installed the module in Drupal 11, the following error occurred:

PHP Fatal error:  Type of Drupal\migrate_wizard\Form\BaseFormFields::$typedConfigManager 
must be Drupal\Core\Config\TypedConfigManagerInterface (as in class Drupal\Core\Form\ConfigFormBase)
This happened because Drupal 11 enforces stricter type-checking. The BaseFormFields class extends ConfigFormBase, which already defines $typedConfigManager as an instance of TypedConfigManagerInterface.

However, in the module's code, the property was declared without a type:

protected $typedConfigManager = NULL;

This meant that when Drupal tried to validate the type against the parent class (ConfigFormBase), it found a mismatch, causing the fatal error.

Solution: Proper Type Hinting

To resolve this issue, we explicitly declared the $typedConfigManager variable with the correct type in the constructor

Please review.
Thanks

sayan_k_dutta’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.72 MB
new13.4 MB

Cloned the repo and reviewed the MR. It seems that the MR solves the issue of PHP Fatal Error perfectly which was occuring during enabling the module. Attaching screencasts for reference and moving this to RTBC.

carlos romero’s picture

Thank you for reporting and collaborating.

I'm closing this issue!

carlos romero’s picture

Status: Reviewed & tested by the community » Fixed
carlos romero’s picture

Status: Fixed » Closed (fixed)