Error accessing the administration form

Created on 17 January 2025, 19 days ago

Problem/Motivation

As I mentioned in the title after install this module an trying to access to the admin form (in order to set the entities to use) the site present the following error:

The website encountered an unexpected error. Try again later.

ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/taxonomy_entity_index/src/Form/TaxonomyEntityIndexAdminForm.php on line 27 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of core/lib/Drupal/Core/Form/ConfigFormBase.php).

Steps to reproduce

Install Drupal 11.1.1
Install Taxonomy entity index module (composer require 'drupal/taxonomy_entity_index:^1.18')
Try accessing to the admin form, for example: https://d11-testing.ddev.site/admin/config/system/taxonomy-entity-index

Proposed resolution

I was able to make it work doing the next changes:

Edit class: web/modules/contrib/taxonomy_entity_index/src/Form/TaxonomyEntityIndexAdminForm.php
Add the right signature to the construtor:

public function __construct(ConfigFactoryInterface $configFactory, TypedConfigManagerInterface $typedConfigManager, protected EntityTypeManagerInterface $entityTypeManager) {
    parent::__construct($configFactory, $typedConfigManager, $entityTypeManager);
  }

end make the adjustments into the create method:

public static function create(ContainerInterface $container): static {
    return new static(
      $container->get('config.factory'),
      $container->get('config.typed'),
      $container->get('entity_type.manager')
    );
  }

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

1.18

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡ทArgentina jpfrancesconi Paranรก, Entre Rรญos.

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