From d3dd9ac2dcc626bf82c3242b1368a04dc7d60f3f Mon Sep 17 00:00:00 2001
From: kalash jain <62080-kalashjain72@users.noreply.drupalcode.org>
Date: Tue, 24 Dec 2024 11:38:20 +0000
Subject: [PATCH] Issue #3494293 by kalash-j, anybody: ArgumentCountError: Too
 few arguments to function Drupal\Core\Form\ConfigFormBase::__construct() in
 Drupal 11

---
 src/Form/ProtectedFormsForm.php | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/Form/ProtectedFormsForm.php b/src/Form/ProtectedFormsForm.php
index b981fe9..8af1e98 100644
--- a/src/Form/ProtectedFormsForm.php
+++ b/src/Form/ProtectedFormsForm.php
@@ -3,6 +3,7 @@
 namespace Drupal\protected_forms\Form;
 
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Config\TypedConfigManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
@@ -26,6 +27,7 @@ class ProtectedFormsForm extends ConfigFormBase {
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('config.factory'),
+      $container->get('config.typed'),
       $container->get('module_handler')
     );
   }
@@ -35,11 +37,13 @@ class ProtectedFormsForm extends ConfigFormBase {
    *
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   The factory for configuration objects.
+   * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config
+   *   The typed config manager.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
-   *   The moduler handler.
+   *   The module handler.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $moduleHandler) {
-    parent::__construct($config_factory);
+  public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $moduleHandler) {
+    parent::__construct($config_factory, $typed_config);
     $this->moduleHandler = $moduleHandler;
   }
 
-- 
GitLab