reverted: --- b/core/lib/Drupal/Core/Block/BlockOperationsProviderInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -getPlugin(); - $links = []; - if ($plugin instanceof BlockOperationsProviderInterface) { - $links = $plugin->getOperationLinks(); + if (method_exists($plugin, 'getOperationLinks')) { + return $plugin->getOperationLinks(); } - - return $links; + return []; } } diff -u b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php --- b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php +++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php @@ -6,7 +6,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Block\BlockBase; use Drupal\Core\Block\BlockManagerInterface; -use Drupal\Core\Block\BlockOperationsProviderInterface; use Drupal\Core\Entity\EntityDisplayRepositoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; @@ -25,7 +24,7 @@ * deriver = "Drupal\block_content\Plugin\Derivative\BlockContent" * ) */ -class BlockContentBlock extends BlockBase implements ContainerFactoryPluginInterface, BlockOperationsProviderInterface { +class BlockContentBlock extends BlockBase implements ContainerFactoryPluginInterface { /** * The Plugin Block Manager. diff -u b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php --- b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php @@ -3,14 +3,12 @@ namespace Drupal\system\Plugin\Block; use Drupal\Core\Block\BlockBase; -use Drupal\Core\Block\BlockOperationsProviderInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Menu\MenuActiveTrailInterface; use Drupal\Core\Menu\MenuLinkTreeInterface; use Drupal\Core\Menu\MenuTreeParameters; -use Drupal\Core\Session\AccountInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Url; use Drupal\system\Entity\Menu; @@ -29,7 +27,7 @@ * }, * ) */ -class SystemMenuBlock extends BlockBase implements ContainerFactoryPluginInterface, BlockOperationsProviderInterface { +class SystemMenuBlock extends BlockBase implements ContainerFactoryPluginInterface { /** * The menu link tree service. @@ -54,11 +52,4 @@ /** - * The current user. - * - * @var \Drupal\Core\Session\AccountInterface - */ - protected AccountInterface $user; - - /** * Constructs a new SystemMenuBlock. * @@ -74,24 +65,17 @@ * The active menu trail service. * @param \Drupal\Core\Extension\ModuleHandlerInterface|null $module_handler * The module handler used to check whether menu_ui is installed. - * @param \Drupal\Core\Session\AccountInterface|null $user - * The current user. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail, ModuleHandlerInterface $module_handler = NULL, AccountInterface $user = NULL) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail, ModuleHandlerInterface $module_handler = NULL) { parent::__construct($configuration, $plugin_id, $plugin_definition); if (is_null($module_handler)) { @trigger_error('The SystemMenuBlock constructor now accepts \Drupal\Core\Extension\ModuleHandlerInterface in drupal:10.1.0 and is required in drupal:11.0.0. See https://www.drupal.org/node/3333923.', E_USER_DEPRECATED); } - if (is_null($user)) { - @trigger_error('The SystemMenuBlock constructor now accepts \Drupal\Core\Session\AccountInterface in drupal:10.1.0 and is required in drupal:11.0.0. See https://www.drupal.org/node/3333923.', E_USER_DEPRECATED); - } - $this->menuTree = $menu_tree; $this->menuActiveTrail = $menu_active_trail; $this->moduleHandler = $module_handler; - $this->user = $user; } /** @@ -105,7 +89,6 @@ $container->get('menu.link_tree'), $container->get('menu.active_trail'), $container->get('module_handler'), - $container->get('current_user'), ); } diff -u b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php --- b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php +++ b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php @@ -2,7 +2,6 @@ namespace Drupal\views\Plugin\Block; -use Drupal\Core\Block\BlockOperationsProviderInterface; use Drupal\Core\Url; use Drupal\Core\Access\AccessResult; use Drupal\Core\Block\BlockBase; @@ -17,7 +16,7 @@ /** * Base class for Views block plugins. */ -abstract class ViewsBlockBase extends BlockBase implements ContainerFactoryPluginInterface, BlockOperationsProviderInterface { +abstract class ViewsBlockBase extends BlockBase implements ContainerFactoryPluginInterface { /** * The View executable object.