From 3da83a059c7b248ddee5adb5fce690a1dd1f6cec Mon Sep 17 00:00:00 2001 From: Liam Morland <lkmorlan@uwaterloo.ca> Date: Tue, 12 Apr 2022 10:41:29 -0400 Subject: [PATCH] Issue #3274842: Inject ModuleHandler dependency --- src/Controller/HandlePdfController.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Controller/HandlePdfController.php b/src/Controller/HandlePdfController.php index 249270c..cf592eb 100644 --- a/src/Controller/HandlePdfController.php +++ b/src/Controller/HandlePdfController.php @@ -4,6 +4,7 @@ namespace Drupal\fillpdf\Controller; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Link; use Drupal\Core\StreamWrapper\StreamWrapperInterface; use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; @@ -88,6 +89,13 @@ class HandlePdfController extends ControllerBase { */ protected $configFactory; + /** + * The module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + /** * Constructs a FillPdfBackendManager object. * @@ -109,6 +117,8 @@ class HandlePdfController extends ControllerBase { * Provides a StreamWrapper manager. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The configuration factory. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler service. */ public function __construct( FillPdfLinkManipulatorInterface $link_manipulator, @@ -119,7 +129,8 @@ class HandlePdfController extends ControllerBase { FillPdfActionPluginManager $action_manager, BackendProxyInterface $backend_proxy, StreamWrapperManagerInterface $stream_wrapper_manager, - ConfigFactoryInterface $config_factory + ConfigFactoryInterface $config_factory, + ModuleHandlerInterface $module_handler ) { $this->linkManipulator = $link_manipulator; $this->contextManager = $context_manager; @@ -130,6 +141,7 @@ class HandlePdfController extends ControllerBase { $this->backendProxy = $backend_proxy; $this->streamWrapperManager = $stream_wrapper_manager; $this->configFactory = $config_factory; + $this->moduleHandler = $module_handler; } /** @@ -145,7 +157,8 @@ class HandlePdfController extends ControllerBase { $container->get('plugin.manager.fillpdf_action.processor'), $container->get('fillpdf.backend_proxy'), $container->get('stream_wrapper_manager'), - $container->get('config.factory') + $container->get('config.factory'), + $container->get('module_handler') ); } -- GitLab