RecaptchaElementSettingsForm causes exception to be thrown in Drupal 11

Created on 9 January 2025, 14 days ago

Problem/Motivation

The ConfigFormBase class extended by the RecaptchaElementSettingsForm class has been updated from Drupal 10.2 to accept a second argument that is required in Drupal 11. Installing this module in Drupal 11 and visiting the settings configuration page causes and exception to thrown.

Steps to reproduce

Install the module in Drupal 11 and visit the settings configuration page.

Proposed resolution

Add the new parameter to the RecaptchaElementSettingsForm class.

/**
   * Constructs a RecaptchaElementSettingsForm object.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   Config factory service.
   * @param \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery
   *   Library discovery service.
   */
  public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config_manager, LibraryDiscoveryInterface $library_discovery) {
    parent::__construct($config_factory, $typed_config_manager);
    $this->libraryDiscovery = $library_discovery;
  }

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

https://www.drupal.org/node/3404140

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇬🇧United Kingdom simonp98

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