diff --git a/core/modules/block_content/block_content.links.task.yml b/core/modules/block_content/block_content.links.task.yml index 2b88171..fc2b024 100644 --- a/core/modules/block_content/block_content.links.task.yml +++ b/core/modules/block_content/block_content.links.task.yml @@ -12,14 +12,14 @@ entity.block_content_type.collection: parent_id: entity.block_content.collection weight: 1 -entity.block_content.canonical: +entity.block_content.edit_form: title: Edit - route_name: entity.block_content.canonical - base_route: entity.block_content.canonical + route_name: entity.block_content.edit_form + base_route: entity.block_content.edit_form entity.block_content.delete_form: title: Delete route_name: entity.block_content.delete_form - base_route: entity.block_content.canonical + base_route: entity.block_content.edit_form # Default tab for custom block type editing. entity.block_content_type.edit_form: diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index b87b18e..9ddb654 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -44,7 +44,7 @@ * links = { * "canonical" = "/block/{block_content}", * "delete-form" = "/block/{block_content}/delete", - * "edit-form" = "/block/{block_content}", + * "edit-form" = "/block/{block_content}/edit", * "collection" = "/admin/structure/block/block-content", * }, * translatable = TRUE, diff --git a/core/modules/block_content/src/Tests/PageEditTest.php b/core/modules/block_content/src/Tests/PageEditTest.php index 3577547..f742eb1 100644 --- a/core/modules/block_content/src/Tests/PageEditTest.php +++ b/core/modules/block_content/src/Tests/PageEditTest.php @@ -35,7 +35,7 @@ public function testPageEdit() { $this->assertTrue($block, 'Custom block found in database.'); // Load the edit page. - $this->drupalGet('block/' . $block->id()); + $this->drupalGet($block->urlInfo('edit-form')); $this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.'); $this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.'); @@ -47,7 +47,7 @@ public function testPageEdit() { $this->drupalPostForm(NULL, $edit, t('Save')); // Edit the same block, creating a new revision. - $this->drupalGet("block/" . $block->id()); + $this->drupalGet($block->urlInfo('edit-form')); $edit = array(); $edit['info[0][value]'] = $this->randomMachineName(8); $edit[$body_key] = $this->randomMachineName(16); @@ -59,7 +59,7 @@ public function testPageEdit() { $this->assertNotIdentical($block->getRevisionId(), $revised_block->getRevisionId(), 'A new revision has been created.'); // Test deleting the block. - $this->drupalGet("block/" . $revised_block->id()); + $this->drupalGet($block->urlInfo('edit-form')); $this->clickLink(t('Delete')); $this->assertText(format_string('Are you sure you want to delete !label?', array('!label' => $revised_block->label()))); } diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index e108f77..8d54ed6 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -43,7 +43,7 @@ * "bundle" = "bundle" * }, * links = { - * "canonical" = "/admin/structure/menu/item/{menu_link_content}/edit", + * "canonical" = "/admin/structure/menu/item/{menu_link_content}", * "edit-form" = "/admin/structure/menu/item/{menu_link_content}/edit", * "delete-form" = "/admin/structure/menu/item/{menu_link_content}/delete", * } diff --git a/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php b/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php index 34f38e2..4ca04ad 100644 --- a/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php @@ -187,7 +187,7 @@ public function getDeleteRoute() { * {@inheritdoc} */ public function getEditRoute() { - return $this->getEntity()->urlInfo(); + return $this->getEntity()->urlInfo('edit-form'); } /**