diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index cba8459..d81193e 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -196,7 +196,7 @@ public function getStorageController($entity_type) { * A list controller instance. */ public function getListController($entity_type) { - return $this->getController($entity_type, 'listing'); + return $this->getController($entity_type, 'list'); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityTypes.php b/core/lib/Drupal/Core/Entity/EntityTypes.php index 2d2b5c2..a1b1610 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypes.php +++ b/core/lib/Drupal/Core/Entity/EntityTypes.php @@ -57,7 +57,10 @@ protected function factory($class) { } protected function invokeHooks() { - $this->moduleHandler()->invokeAll('entity_info', array($this->types)); + foreach ($this->moduleHandler()->getImplementations('entity_info') as $module) { + $function = $module . '_entity_info'; + $function($this->types); + } $this->moduleHandler()->alter('entity_info', $this->types); } diff --git a/core/modules/action/action.module b/core/modules/action/action.module index 58bb4a8..8778a68 100644 --- a/core/modules/action/action.module +++ b/core/modules/action/action.module @@ -71,8 +71,12 @@ function action_menu() { * Implements hook_entity_info(). */ function action_entity_info(&$entity_info) { - $entity_info['action']['controllers']['form']['add'] = 'Drupal\action\ActionAddFormController'; - $entity_info['action']['controllers']['form']['edit'] = 'Drupal\action\ActionEditFormController'; - $entity_info['action']['controllers']['form']['delete'] = 'Drupal\action\Form\ActionDeleteForm'; - $entity_info['action']['controllers']['list'] = 'Drupal\action\ActionListController'; + if (isset($entity_info['action'])) { + $controllers = $entity_info['action']->getController('form'); + $controllers['add'] = 'Drupal\action\ActionAddFormController'; + $controllers['edit'] = 'Drupal\action\ActionEditFormController'; + $controllers['delete'] = 'Drupal\action\Form\ActionDeleteForm'; + $entity_info['action']->setController('form', $controllers); + $entity_info['action']->setController('list', 'Drupal\action\ActionListController'); + } } diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 8fb085a..259a2e9 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -253,8 +253,14 @@ function field_ui_element_info() { * Implements hook_entity_info(). */ function field_ui_entity_info(&$entity_info) { - $entity_info['field_instance']['controllers']['form']['delete'] = 'Drupal\field_ui\Form\FieldDeleteForm'; - $entity_info['field_entity']['controllers']['list'] = 'Drupal\field_ui\FieldListController'; + if (isset($entity_info['field_instance'])) { + $controllers = $entity_info['field_instance']->getController('form'); + $controllers['delete'] = 'Drupal\field_ui\Form\FieldDeleteForm'; + $entity_info['field_instance']->setController('form', $controllers); + } + if (isset($entity_info['field_entity'])) { + $entity_info['field_entity']->setController('list', 'Drupal\field_ui\FieldListController'); + } } /** diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index ddfbe25..ef2dd8d 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -150,15 +150,16 @@ function menu_entity_info(&$entity_info) { $entity_info['menu']->setController('list', 'Drupal\menu\MenuListController'); $entity_info['menu']->setController('access', 'Drupal\menu\MenuAccessController'); $entity_info['menu']->setUriCallback('menu_uri'); - $entity_info['menu']->setController('form', array( - 'default' => 'Drupal\menu\MenuFormController', - 'delete' => 'Drupal\menu\Form\MenuDeleteForm', - )); + $controllers = $entity_info['menu']->getController('form'); + $controllers['default'] = 'Drupal\menu\MenuFormController'; + $controllers['delete'] = 'Drupal\menu\Form\MenuDeleteForm'; + $entity_info['menu']->setController('form', $controllers); } if (isset($entity_info['menu_link'])) { $controllers = $entity_info['menu_link']->getController('form'); - $controllers['form']['delete'] = 'Drupal\menu\Form\MenuLinkDeleteForm'; - $controllers['form']['reset'] = 'Drupal\menu\Form\MenuLinkResetForm'; + $controllers['delete'] = 'Drupal\menu\Form\MenuLinkDeleteForm'; + $controllers['reset'] = 'Drupal\menu\Form\MenuLinkResetForm'; + $entity_info['menu_link']->setController('form', $controllers); } } diff --git a/core/modules/node/lib/Drupal/node/NodeAccessController.php b/core/modules/node/lib/Drupal/node/NodeAccessController.php index c0106a7..c46f565 100644 --- a/core/modules/node/lib/Drupal/node/NodeAccessController.php +++ b/core/modules/node/lib/Drupal/node/NodeAccessController.php @@ -7,16 +7,14 @@ namespace Drupal\node; -use Drupal\Core\Database\Connection; -use Drupal\Core\Database\Query\SelectInterface; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityType; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Language\Language; use Drupal\Core\Entity\EntityAccessController; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityNG; use Drupal\Core\Session\AccountInterface; -use Drupal\user\Plugin\Core\Entity\User; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -27,7 +25,7 @@ class NodeAccessController extends EntityAccessController implements NodeAccessC /** * The node grant storage. * - * @var \Drupal\node\NodeGrantStorageControllerInterface + * @var \Drupal\node\NodeGrantDatabaseStorageInterface */ protected $grantStorage; @@ -43,6 +41,8 @@ class NodeAccessController extends EntityAccessController implements NodeAccessC * * @param \Drupal\node\NodeGrantDatabaseStorageInterface $grant_storage * The node grant storage. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler. */ public function __construct(NodeGrantDatabaseStorageInterface $grant_storage, ModuleHandlerInterface $module_handler) { $this->grantStorage = $grant_storage; @@ -52,7 +52,7 @@ public function __construct(NodeGrantDatabaseStorageInterface $grant_storage, Mo /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function createInstance(ContainerInterface $container, $entity_type, EntityType $entity_info) { return new static( $container->get('node.grant_storage'), $container->get('module_handler') diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index be8b722..d9b3d67 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -97,14 +97,15 @@ function views_ui_menu() { */ function views_ui_entity_info(&$entity_info) { if (isset($entity_info['view'])) { - $controllers = $entity_info['view']->getControllers(); - $controllers['list'] = 'Drupal\views_ui\ViewListController'; - $controllers['form']['edit'] = 'Drupal\views_ui\ViewEditFormController'; - $controllers['form']['add'] = 'Drupal\views_ui\ViewAddFormController'; - $controllers['form']['preview'] = 'Drupal\views_ui\ViewPreviewFormController'; - $controllers['form']['clone'] = 'Drupal\views_ui\ViewCloneFormController'; - $controllers['form']['delete'] = 'Drupal\views_ui\ViewDeleteFormController'; - $controllers['form']['break_lock'] = 'Drupal\views_ui\Form\BreakLockForm'; + $controllers = $entity_info['view']->getController('form'); + $controllers['edit'] = 'Drupal\views_ui\ViewEditFormController'; + $controllers['add'] = 'Drupal\views_ui\ViewAddFormController'; + $controllers['preview'] = 'Drupal\views_ui\ViewPreviewFormController'; + $controllers['clone'] = 'Drupal\views_ui\ViewCloneFormController'; + $controllers['delete'] = 'Drupal\views_ui\ViewDeleteFormController'; + $controllers['break_lock'] = 'Drupal\views_ui\Form\BreakLockForm'; + $entity_info['view']->setController('form', $controllers); + $entity_info['view']->setController('list', 'Drupal\views_ui\ViewListController'); } }