From e356ea60662a411369faed3d2c81ee664d2e3044 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 12 Jul 2023 08:13:40 -0400 Subject: [PATCH] Add missing container dependency to ChannelsController. (#2989) --- .../VuFind/src/VuFind/Controller/ChannelsController.php | 8 ++++++-- .../src/VuFind/Controller/ChannelsControllerFactory.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/VuFind/src/VuFind/Controller/ChannelsController.php b/module/VuFind/src/VuFind/Controller/ChannelsController.php index e41c9c2a8cb..82c30cb2ffd 100644 --- a/module/VuFind/src/VuFind/Controller/ChannelsController.php +++ b/module/VuFind/src/VuFind/Controller/ChannelsController.php @@ -29,6 +29,7 @@ namespace VuFind\Controller; +use Laminas\ServiceManager\ServiceLocatorInterface; use VuFind\ChannelProvider\ChannelLoader; /** @@ -54,11 +55,14 @@ class ChannelsController extends AbstractBase /** * Constructor * - * @param ChannelLoader $loader Channel loader + * @param ChannelLoader $loader Channel loader + * @param ServiceLocatorInterface $sm Top-level service manager (needed for + * some AbstractBase behavior) */ - public function __construct(ChannelLoader $loader) + public function __construct(ChannelLoader $loader, ServiceLocatorInterface $sm) { $this->loader = $loader; + parent::__construct($sm); } /** diff --git a/module/VuFind/src/VuFind/Controller/ChannelsControllerFactory.php b/module/VuFind/src/VuFind/Controller/ChannelsControllerFactory.php index 7687ad061ce..15e81ac8178 100644 --- a/module/VuFind/src/VuFind/Controller/ChannelsControllerFactory.php +++ b/module/VuFind/src/VuFind/Controller/ChannelsControllerFactory.php @@ -68,6 +68,6 @@ public function __invoke( throw new \Exception('Unexpected options sent to factory.'); } $loader = $container->get(\VuFind\ChannelProvider\ChannelLoader::class); - return $this->applyPermissions($container, new $requestedName($loader)); + return $this->applyPermissions($container, new $requestedName($loader, $container)); } }