diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 4eceb30..e358d64 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -250,7 +250,7 @@ function custom_block_form_block_plugin_ui_alter(&$form, $form_state) { $custom_block = entity_load_by_uuid('custom_block', $derivative); $row['1']['data']['#links']['edit'] = array( 'title' => t('Edit'), - 'href' => 'block/' . $custom_block->id() . '/edit' + 'href' => 'block/' . $custom_block->id(), ); } } diff --git a/core/modules/block/custom_block/custom_block.routing.yml b/core/modules/block/custom_block/custom_block.routing.yml index 40d73bd..2af487a 100644 --- a/core/modules/block/custom_block/custom_block.routing.yml +++ b/core/modules/block/custom_block/custom_block.routing.yml @@ -11,6 +11,7 @@ custom_block_edit: _entity_form: 'custom_block.edit' requirements: _entity_access: 'custom_block.update' + custom_block: \d+ custom_block_type_add: pattern: '/admin/structure/custom-blocks/add' diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlock.php index 1f5b2ee..f53365b 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlock.php @@ -25,6 +25,7 @@ * "access" = "Drupal\custom_block\CustomBlockAccessController", * "render" = "Drupal\custom_block\CustomBlockRenderController", * "form" = { + * "default" = "Drupal\custom_block\CustomBlockFormController", * "add" = "Drupal\custom_block\CustomBlockFormController", * "edit" = "Drupal\custom_block\CustomBlockFormController" * }, diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php index 8b8a827..b796e25 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php @@ -44,7 +44,7 @@ public function testPageEdit() { $this->assertTrue($block, 'Custom block found in database.'); // Load the edit page. - $this->drupalGet('block/' . $block->id() . '/edit'); + $this->drupalGet('block/' . $block->id()); $this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.'); $this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.'); @@ -56,7 +56,7 @@ public function testPageEdit() { $this->drupalPost(NULL, $edit, t('Save')); // Edit the same block, creating a new revision. - $this->drupalGet("block/" . $block->id() . "/edit"); + $this->drupalGet("block/" . $block->id()); $edit = array(); $edit['info'] = $this->randomName(8); $edit[$body_key] = $this->randomName(16); @@ -68,7 +68,7 @@ public function testPageEdit() { $this->assertNotIdentical($block->revision_id->value, $revised_block->revision_id->value, 'A new revision has been created.'); // Test deleting the block. - $this->drupalGet("block/" . $revised_block->id() . "/edit"); + $this->drupalGet("block/" . $revised_block->id()); $this->drupalPost(NULL, array(), t('Delete')); $this->assertText(format_string('Are you sure you want to delete !label?', array('!label' => $revised_block->label()))); }