diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php b/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php index bef3e7f..66987c8 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php @@ -11,6 +11,7 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityManager; +use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -40,6 +41,13 @@ class AggregatorController implements ControllerInterface { protected $configFactory; /** + * The module handler. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** * Constructs a \Drupal\aggregator\Routing\AggregatorController object. * * @param \Drupal\Core\Entity\EntityManager $entity_manager @@ -48,11 +56,14 @@ class AggregatorController implements ControllerInterface { * The database connection. * @param \Drupal\Core\Config\ConfigFactory $config_factory * The config factory. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler. */ - public function __construct(EntityManager $entity_manager, Connection $database, ConfigFactory $config_factory) { + public function __construct(EntityManager $entity_manager, Connection $database, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler) { $this->entityManager = $entity_manager; $this->database = $database; $this->configFactory = $config_factory; + $this->moduleHandler = $module_handler; } /** @@ -62,7 +73,8 @@ public static function create(ContainerInterface $container) { return new static( $container->get('plugin.manager.entity'), $container->get('database'), - $container->get('config.factory') + $container->get('config.factory'), + $container->get('module_handler') ); } @@ -173,7 +185,7 @@ public function adminOverview() { */ public function categories() { // @todo Refactor this once all controller conversions are complete. - \Drupal::moduleHandler()->loadInclude('aggregator', 'inc', 'aggregator.pages'); + $this->moduleHandler->loadInclude('aggregator', 'inc', 'aggregator.pages'); $result = $this->database->query('SELECT c.cid, c.title, c.description FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid LEFT JOIN {aggregator_item} i ON ci.iid = i.iid GROUP BY c.cid, c.title, c.description');