Fix ConfigForm error for Drupal 11

Created on 20 February 2025, about 2 months ago

Problem/Motivation

In Drupal 11, it looks like the ConfigFormBase constructor requires 2 arguments:

  /**
   * Constructs a \Drupal\system\ConfigFormBase object.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The factory for configuration objects.
   * @param \Drupal\Core\Config\TypedConfigManagerInterface $typedConfigManager
   *   The typed config manager.
   */
  public function __construct(
    ConfigFactoryInterface $config_factory,
    protected TypedConfigManagerInterface $typedConfigManager,
  ) {
    $this->setConfigFactory($config_factory);
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static(
      $container->get('config.factory'),
      $container->get('config.typed')
    );
  }

Most of the our Forms that extends ConfigFormBase such as K8sAdminSettings, AwsCloudAdminSettings only pass one parameter.

πŸ› Bug report
Status

Active

Version

8.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States baldwinlouie

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