diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListController.php b/core/lib/Drupal/Core/Config/Entity/DraggableListController.php index 5370be5..9c4c5bd 100644 --- a/core/lib/Drupal/Core/Config/Entity/DraggableListController.php +++ b/core/lib/Drupal/Core/Config/Entity/DraggableListController.php @@ -8,9 +8,11 @@ namespace Drupal\Core\Config\Entity; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityOperationsProviderInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormInterface; +use Drupal\Core\Session\AccountInterface; /** * Provides a list controller for draggable configuration entities. @@ -41,8 +43,8 @@ /** * {@inheritdoc} */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler) { - parent::__construct($entity_type, $entity_info, $storage, $module_handler); + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, EntityOperationsProviderInterface $operations, ModuleHandlerInterface $module_handler, AccountInterface $current_user) { + parent::__construct($entity_type, $entity_info, $storage, $operations, $module_handler, $current_user); // Check if the entity type supports weighting. if (!empty($this->entityInfo['entity_keys']['weight'])) { diff --git a/core/modules/action/lib/Drupal/action/ActionListController.php b/core/modules/action/lib/Drupal/action/ActionListController.php index 94df542..dd999e2 100644 --- a/core/modules/action/lib/Drupal/action/ActionListController.php +++ b/core/modules/action/lib/Drupal/action/ActionListController.php @@ -11,8 +11,10 @@ use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Config\Entity\ConfigEntityListController; +use Drupal\Core\Entity\EntityOperationsProviderInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -41,13 +43,17 @@ class ActionListController extends ConfigEntityListController implements EntityC * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The action storage controller. + * @param \Drupal\Core\Entity\EntityOperationsProviderInterface $operations + * The entity operations provider. * @param \Drupal\Core\Action\ActionManager $action_manager * The action plugin manager. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. + * @param |Drupal\Core\Session\AccountInterface $current_user + * The current user. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ActionManager $action_manager, ModuleHandlerInterface $module_handler) { - parent::__construct($entity_type, $entity_info, $storage, $module_handler); + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, EntityOperationsProviderInterface $operations, ActionManager $action_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user) { + parent::__construct($entity_type, $entity_info, $storage, $operations, $module_handler, $current_user); $this->actionManager = $action_manager; } @@ -60,8 +66,10 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_type, $entity_info, $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getOperationsProvider($entity_type), $container->get('plugin.manager.action'), - $container->get('module_handler') + $container->get('module_handler'), + $container->get('current_user') ); } diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index 2e2f292..90cd994 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -13,9 +13,11 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityOperationsProviderInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormInterface; +use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -60,14 +62,18 @@ class BlockListController extends ConfigEntityListController implements FormInte * @param array $entity_info * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage + * @param \Drupal\Core\Entity\EntityOperationsProviderInterface $operations + * The entity operations provider. * The entity storage controller class. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. * @param \Drupal\Component\Plugin\PluginManagerInterface $block_manager * The block manager. + * @param |Drupal\Core\Session\AccountInterface $current_user + * The current user. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, PluginManagerInterface $block_manager) { - parent::__construct($entity_type, $entity_info, $storage, $module_handler); + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, EntityOperationsProviderInterface $operations, ModuleHandlerInterface $module_handler, PluginManagerInterface $block_manager, AccountInterface $current_user) { + parent::__construct($entity_type, $entity_info, $storage, $operations, $module_handler, $current_user); $this->blockManager = $block_manager; } @@ -80,8 +86,10 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_type, $entity_info, $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getOperationsProvider($entity_type), $container->get('module_handler'), - $container->get('plugin.manager.block') + $container->get('plugin.manager.block'), + $container->get('current_user') ); } diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php index 19ee07f..b207572 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php @@ -19,6 +19,7 @@ * id = "config_test", * label = @Translation("Test configuration"), * controllers = { + * "operations" = "Drupal\Core\Config\Entity\ConfigEntityOperationsProvider", * "storage" = "Drupal\config_test\ConfigTestStorageController", * "list" = "Drupal\config_test\ConfigTestListController", * "form" = { diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php index 835c1c6..81227c8 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php @@ -9,8 +9,10 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityOperationsProviderInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -34,13 +36,17 @@ class EntityDisplayModeListController extends ConfigEntityListController { * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityOperationsProviderInterface $operations + * The entity operations provider. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. + * @param |Drupal\Core\Session\AccountInterface $current_user + * The current user. * @param array $entity_info_complete * The entity info for all entity types. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, array $entity_info_complete) { - parent::__construct($entity_type, $entity_info, $storage, $module_handler); + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, EntityOperationsProviderInterface $operations, ModuleHandlerInterface $module_handler, AccountInterface $current_user, array $entity_info_complete) { + parent::__construct($entity_type, $entity_info, $storage, $operations, $module_handler, $current_user); $this->entityInfoComplete = $entity_info_complete; } @@ -54,7 +60,9 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_type, $entity_info, $entity_manager->getStorageController($entity_type), + $entity_manager->getOperationsProvider($entity_type), $container->get('module_handler'), + $container->get('current_user'), $entity_manager->getDefinitions() ); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php index 0025379..5ea2ac5 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php @@ -12,6 +12,7 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Field\FieldTypePluginManager; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -58,13 +59,15 @@ class FieldListController extends ConfigEntityListController { * The entity manager. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. + * @param |Drupal\Core\Session\AccountInterface $current_user + * The current user. * @param \Drupal\field\FieldInfo $field_info * The field info service. * @param \Drupal\Core\Field\FieldTypePluginManager $field_type_manager * The 'field type' plugin manager. */ - public function __construct($entity_type, array $entity_info, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, FieldTypePluginManager $field_type_manager) { - parent::__construct($entity_type, $entity_info, $entity_manager->getStorageController($entity_type), $module_handler); + public function __construct($entity_type, array $entity_info, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, FieldTypePluginManager $field_type_manager) { + parent::__construct($entity_type, $entity_info, $entity_manager->getStorageController($entity_type), $entity_manager->getOperationsProvider($entity_type), $module_handler, $current_user); $this->entityManager = $entity_manager; $this->bundles = entity_get_bundles(); @@ -81,6 +84,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_info, $container->get('entity.manager'), $container->get('module_handler'), + $container->get('current_user'), $container->get('plugin.manager.field.field_type') ); } diff --git a/core/modules/image/lib/Drupal/image/ImageStyleListController.php b/core/modules/image/lib/Drupal/image/ImageStyleListController.php index 984fe89..54997f7 100644 --- a/core/modules/image/lib/Drupal/image/ImageStyleListController.php +++ b/core/modules/image/lib/Drupal/image/ImageStyleListController.php @@ -10,9 +10,11 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityOperationsProviderInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Routing\UrlGeneratorInterface; +use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\Translator\TranslatorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -37,13 +39,17 @@ class ImageStyleListController extends ConfigEntityListController implements Ent * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $image_style_storage * The image style entity storage controller class. + * @param \Drupal\Core\Entity\EntityOperationsProviderInterface $operations + * The entity operations provider. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. + * @param |Drupal\Core\Session\AccountInterface $current_user + * The current user. * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator * The URL generator. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $image_style_storage, ModuleHandlerInterface $module_handler, UrlGeneratorInterface $url_generator) { - parent::__construct($entity_type, $entity_info, $image_style_storage, $module_handler); + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $image_style_storage, EntityOperationsProviderInterface $operations, ModuleHandlerInterface $module_handler, AccountInterface $current_user, UrlGeneratorInterface $url_generator) { + parent::__construct($entity_type, $entity_info, $image_style_storage, $operations, $module_handler, $current_user); $this->urlGenerator = $url_generator; } @@ -55,7 +61,9 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_type, $entity_info, $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getOperationsProvider($entity_type), $container->get('module_handler'), + $container->get('current_user'), $container->get('url_generator'), $container->get('string_translation') ); diff --git a/core/modules/node/lib/Drupal/node/NodeTypeListController.php b/core/modules/node/lib/Drupal/node/NodeTypeListController.php index b43245a..5aa5fbc 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeListController.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeListController.php @@ -8,6 +8,8 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Entity\EntityOperationsProviderInterface; +use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -37,13 +39,17 @@ class NodeTypeListController extends ConfigEntityListController implements Entit * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityOperationsProviderInterface $operations + * The entity operations provider. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. + * @param |Drupal\Core\Session\AccountInterface $current_user + * The current user. * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator * The url generator service. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, UrlGeneratorInterface $url_generator) { - parent::__construct($entity_type, $entity_info, $storage, $module_handler); + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, EntityOperationsProviderInterface $operations, ModuleHandlerInterface $module_handler, AccountInterface $current_user, UrlGeneratorInterface $url_generator) { + parent::__construct($entity_type, $entity_info, $storage, $operations, $module_handler, $current_user); $this->urlGenerator = $url_generator; } /** @@ -54,7 +60,9 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_type, $entity_info, $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getOperationsProvider($entity_type), $container->get('module_handler'), + $container->get('current_user'), $container->get('url_generator') ); } diff --git a/core/modules/system/lib/Drupal/system/DateFormatListController.php b/core/modules/system/lib/Drupal/system/DateFormatListController.php index d22642b..d87f2a4 100644 --- a/core/modules/system/lib/Drupal/system/DateFormatListController.php +++ b/core/modules/system/lib/Drupal/system/DateFormatListController.php @@ -11,8 +11,10 @@ use Drupal\Core\Config\Entity\ConfigEntityListController; use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityOperationsProviderInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -36,13 +38,17 @@ class DateFormatListController extends ConfigEntityListController { * An array of entity info for the entity type. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityOperationsProviderInterface $operations + * The entity operations provider. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke hooks on. + * @param |Drupal\Core\Session\AccountInterface $current_user + * The current user. * @param \Drupal\Core\Datetime\Date $date_service * The date service. */ - public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, ModuleHandlerInterface $module_handler, Date $date_service) { - parent::__construct($entity_type, $entity_info, $storage, $module_handler); + public function __construct($entity_type, array $entity_info, EntityStorageControllerInterface $storage, EntityOperationsProviderInterface $operations, ModuleHandlerInterface $module_handler, AccountInterface $current_user, Date $date_service) { + parent::__construct($entity_type, $entity_info, $storage, $operations, $module_handler, $current_user); $this->dateService = $date_service; } @@ -55,7 +61,9 @@ public static function createInstance(ContainerInterface $container, $entity_typ $entity_type, $entity_info, $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getOperationsProvider($entity_type), $container->get('module_handler'), + $container->get('current_user'), $container->get('date') ); } diff --git a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php index fb4c7d3..9516a99 100644 --- a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php +++ b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php @@ -21,6 +21,7 @@ * id = "date_format", * label = @Translation("Date format"), * controllers = { + * "operations" = "\Drupal\Core\Config\Entity\ConfigEntityOperationsProvider", * "storage" = "Drupal\Core\Config\Entity\ConfigStorageController", * "access" = "Drupal\system\DateFormatAccessController", * "list" = "Drupal\system\DateFormatListController",