diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index 1281862..8d87de1 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -268,14 +268,17 @@ public function buildForm(array $form, array &$form_state) { * {@inheritdoc} */ public function getOperations(EntityInterface $entity) { + $uri = $entity->uri(); $operations = array(); $operations['configure'] = array( 'title' => t('configure'), - 'href' => 'admin/structure/block/manage/' . $entity->id() . '/configure', + 'href' => $uri['path'] . '/configure', + 'options' => $uri['options'], ); $operations['delete'] = array( 'title' => t('delete'), - 'href' => 'admin/structure/block/manage/' . $entity->id() . '/delete', + 'href' => $uri['path'] . '/delete', + 'options' => $uri['options'], ); return $operations; } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHookOperationTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHookOperationTest.php index 395e620..3621f26 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockHookOperationTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockHookOperationTest.php @@ -20,11 +20,11 @@ class BlockHookOperationTest extends WebTestBase { * * @var array */ - public static $modules = array('block', 'block_test_hook_operation'); + public static $modules = array('block', 'entity_test'); public static function getInfo() { return array( - 'name' => 'Block hook operations', + 'name' => 'Block operations hook', 'description' => 'Implement hook entity operations alter.', 'group' => 'Block', ); @@ -43,20 +43,20 @@ public function setUp() { } /* - * Tests block lists to see if translate link is added to operations. + * Tests the block list to see if the test_operation link is added. */ - public function testTranslateOperationInBlockListUI() { + public function testBlockOperationAlter() { // Add a test block, any block will do. - // Set the machine name so later the translate link can be built. + // Set the machine name so the test_operation link can be built later. $block_machine_name = Unicode::strtolower($this->randomName(16)); $this->drupalPlaceBlock('system_powered_by_block', array('machine_name' => $block_machine_name)); // Get the Block listing. $this->drupalGet('admin/structure/block'); - $translate_link = 'admin/structure/block/manage/stark.' . $block_machine_name . '/translate'; - // Test if the link to translate the block is on the page. - $this->assertLinkByHref($translate_link); + $test_operation_link = 'admin/structure/block/manage/stark.' . $block_machine_name . '/test_operation'; + // Test if the test_operation link is on the page. + $this->assertLinkByHref($test_operation_link); } } diff --git a/core/modules/block/tests/block_test_hook_operation/block_test_hook_operation.info.yml b/core/modules/block/tests/block_test_hook_operation/block_test_hook_operation.info.yml deleted file mode 100644 index 5bf37bd..0000000 --- a/core/modules/block/tests/block_test_hook_operation/block_test_hook_operation.info.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: 'Block test hook operation' -type: module -description: 'Implements a hook to test entity_hook_operations_alter() in blocks.' -package: Core -version: VERSION -hidden: TRUE -core: 8.x -dependencies: - - block diff --git a/core/modules/block/tests/block_test_hook_operation/block_test_hook_operation.module b/core/modules/block/tests/block_test_hook_operation/block_test_hook_operation.module deleted file mode 100644 index 0c570b4..0000000 --- a/core/modules/block/tests/block_test_hook_operation/block_test_hook_operation.module +++ /dev/null @@ -1,19 +0,0 @@ -uri(); - $operations['translate'] = array( - 'title' => t('Translate'), - 'href' => $uri['path'] . '/translate', - 'options' => $uri['options'], - 'weight' => 50, - ); -}