diff --git a/core/includes/menu.inc b/core/includes/menu.inc index e59615c..3079e56 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'); + $menu_link_controller = new MenuLinkStorageController('menu_link', $this->container->get('database')); } // Add normal and suggested items as links. diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php index 198d67a..02619c2 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php @@ -13,6 +13,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityHandlerInterface; + use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -122,9 +123,9 @@ class DatabaseStorageController implements EntityStorageControllerInterface, Ent protected $database; /** - * Implements \Drupal\Core\Entity\EntityHandlerInterface::create(). + * Implements \Drupal\Core\Entity\EntityHandlerInterface::createInstance(). */ - public static function createInstance(ContainerInterface $container, Array $arguments) { + public static function createInstance(ContainerInterface $container, array $arguments) { return new static( $arguments['entity_type'], $container->get('database') @@ -136,6 +137,8 @@ public static function createInstance(ContainerInterface $container, Array $argu * * @param string $entityType * The entity type for which the instance is created. + * @param \Drupal\Core\Database\Connection $database + * The database connection to be used. */ public function __construct($entityType, Connection $database) { $this->database = $database; diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 3cbafa9..9b7ff8c 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -15,6 +15,7 @@ use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; use Drupal\Core\Plugin\Discovery\InfoHookDecorator; use Drupal\Core\Cache\CacheBackendInterface; + use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -176,8 +177,8 @@ class EntityManager extends PluginManagerBase { * * @param array $namespaces * An array of paths keyed by its corresponding namespaces. - * @param Symfony\Component\DependencyInjection\ContainerInterface $container - * A ContainerInterface instance. + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * The service container this object should use. */ public function __construct(array $namespaces, ContainerInterface $container) { // Allow the plugin definition to be altered by hook_entity_info_alter(). 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 f3f5d2d..2503990 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php @@ -10,7 +10,6 @@ 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.