diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 3079e56..485bca9 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2744,7 +2744,7 @@ function _menu_navigation_links_rebuild($menu) { else { // The Menu link module is not available at install time, so we need to // hardcode the default storage controller. - $menu_link_controller = new MenuLinkStorageController('menu_link', $this->container->get('database')); + $menu_link_controller = new MenuLinkStorageController('menu_link', Drupal::service('database')); } // Add normal and suggested items as links. diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 9b7ff8c..4ce5f0c 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -15,7 +15,6 @@ use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; use Drupal\Core\Plugin\Discovery\InfoHookDecorator; use Drupal\Core\Cache\CacheBackendInterface; - use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -277,6 +276,8 @@ public function getControllerClass($entity_type, $controller_type, $nested = NUL public function getStorageController($entity_type) { if (!isset($this->controllers['storage'][$entity_type])) { $class = $this->getControllerClass($entity_type, 'controller_class'); + // @todo remove this once all controllers implement + // Drupal\Core\Entity\EntityHandlerInterface. if (in_array('Drupal\Core\Entity\EntityHandlerInterface', class_implements($class))) { $this->controllers['storage'][$entity_type] = $class::createInstance($this->container, array( 'entity_type' => $entity_type @@ -301,6 +302,8 @@ public function getStorageController($entity_type) { public function getListController($entity_type) { if (!isset($this->controllers['listing'][$entity_type])) { $class = $this->getControllerClass($entity_type, 'list_controller_class'); + // @todo remove this once all controllers implement + // Drupal\Core\Entity\EntityHandlerInterface. if (in_array('Drupal\Core\Entity\EntityHandlerInterface', class_implements($class))) { $this->controllers['listing'][$entity_type] = $class::createInstance($this->container, array( 'entity_type' => $entity_type, @@ -328,6 +331,8 @@ public function getListController($entity_type) { public function getFormController($entity_type, $operation) { if (!isset($this->controllers['form'][$operation][$entity_type])) { $class = $this->getControllerClass($entity_type, 'form_controller_class', $operation); + // @todo remove this once all controllers implement + // Drupal\Core\Entity\EntityHandlerInterface. if (in_array('Drupal\Core\Entity\EntityHandlerInterface', class_implements($class))) { $this->controllers['form'][$operation][$entity_type] = $class::createInstance($this->container, array( 'operation' => $operation @@ -352,6 +357,8 @@ public function getFormController($entity_type, $operation) { public function getRenderController($entity_type) { if (!isset($this->controllers['render'][$entity_type])) { $class = $this->getControllerClass($entity_type, 'render_controller_class'); + // @todo remove this once all controllers implement + // Drupal\Core\Entity\EntityHandlerInterface. if (in_array('Drupal\Core\Entity\EntityHandlerInterface', class_implements($class))) { $this->controllers['render'][$entity_type] = $class::createInstance($this->container, array( 'entity_type' => $entity_type @@ -376,6 +383,8 @@ public function getRenderController($entity_type) { public function getAccessController($entity_type) { if (!isset($this->controllers['access'][$entity_type])) { $class = $this->getControllerClass($entity_type, 'access_controller_class'); + // @todo remove this once all controllers implement + // Drupal\Core\Entity\EntityHandlerInterface. if (in_array('Drupal\Core\Entity\EntityHandlerInterface', class_implements($class))) { $this->controllers['access'][$entity_type] = $class::createInstance($this->container, array( 'entity_type' => $entity_type diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php index 2503990..2a1dbb3 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php @@ -10,6 +10,7 @@ use Drupal\Core\Entity\DatabaseStorageController; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageException; +use Drupal\Core\Database\Connection; /** * Controller class for menu links. @@ -36,7 +37,7 @@ class MenuLinkStorageController extends DatabaseStorageController { /** * Overrides DatabaseStorageController::__construct(). */ - public function __construct($entityType, $database) { + public function __construct($entityType, Connection $database) { parent::__construct($entityType, $database); if (empty(static::$routerItemFields)) {