From 52b34aa9de5c58876a27cd7d2abd86668b58ab86 Mon Sep 17 00:00:00 2001 From: Tara <tarawijayagunawarana@192-168-1-100.tpgi.com.au> Date: Wed, 26 Feb 2025 01:03:50 +1100 Subject: [PATCH] update PermissionBlacklistForm to pass TypedConfigManager and fix missing dependency in ConfigFormBase constructor call --- .../src/Form/PermissionBlacklistForm.php | 6 ++++-- .../src/Form/ProtectedModulesForm.php | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/module_permissions_ui/src/Form/PermissionBlacklistForm.php b/module_permissions_ui/src/Form/PermissionBlacklistForm.php index e69f611..ec82b81 100644 --- a/module_permissions_ui/src/Form/PermissionBlacklistForm.php +++ b/module_permissions_ui/src/Form/PermissionBlacklistForm.php @@ -3,6 +3,7 @@ namespace Drupal\module_permissions_ui\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; @@ -48,8 +49,8 @@ class PermissionBlacklistForm extends ConfigFormBase { * @param \Drupal\user\PermissionHandlerInterface $permission_handler * Permission handler. */ - public function __construct(ConfigFactoryInterface $config_factory, Helper $helper, ModuleHandlerInterface $module_handler, PermissionHandlerInterface $permission_handler) { - parent::__construct($config_factory); + public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config_manager, Helper $helper, ModuleHandlerInterface $module_handler, PermissionHandlerInterface $permission_handler) { + parent::__construct($config_factory, $typed_config_manager); $this->helper = $helper; $this->moduleHandler = $module_handler; $this->permissionHandler = $permission_handler; @@ -61,6 +62,7 @@ class PermissionBlacklistForm extends ConfigFormBase { public static function create(ContainerInterface $container) { return new static( $container->get('config.factory'), + $container->get('config.typed'), $container->get('module_permissions.helper'), $container->get('module_handler'), $container->get('user.permissions') diff --git a/module_permissions_ui/src/Form/ProtectedModulesForm.php b/module_permissions_ui/src/Form/ProtectedModulesForm.php index 2b6a325..71a33ec 100644 --- a/module_permissions_ui/src/Form/ProtectedModulesForm.php +++ b/module_permissions_ui/src/Form/ProtectedModulesForm.php @@ -3,6 +3,7 @@ namespace Drupal\module_permissions_ui\Form; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\Extension\Extension; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -60,12 +61,19 @@ class ProtectedModulesForm extends ConfigFormBase { * @param \Drupal\Core\Extension\ModuleExtensionList $module_list * Module list service. */ - public function __construct(ConfigFactoryInterface $config_factory, Helper $helper, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ModuleExtensionList $module_list) { - parent::__construct($config_factory); + public function __construct( + ConfigFactoryInterface $config_factory, + Helper $helper, + TypedConfigManagerInterface $typed_config_manager, + ModuleInstallerInterface $module_installer, + ModuleExtensionList $module_list, + ModuleHandlerInterface $module_handler + ) { + parent::__construct($config_factory, $typed_config_manager); $this->helper = $helper; - $this->moduleHandler = $module_handler; $this->moduleInstaller = $module_installer; $this->moduleList = $module_list; + $this->moduleHandler = $module_handler; } /** @@ -75,9 +83,10 @@ class ProtectedModulesForm extends ConfigFormBase { return new static( $container->get('config.factory'), $container->get('module_permissions.helper'), - $container->get('module_handler'), + $container->get('config.typed'), $container->get('module_installer'), - $container->get('extension.list.module') + $container->get('extension.list.module'), + $container->get('module_handler') ); } -- GitLab