diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 3b0b30d..555f2d1 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -32,20 +32,20 @@ function custom_block_menu_local_tasks(&$data, $router_item, $root_path) { */ function custom_block_menu() { $items['admin/structure/custom-blocks'] = array( - 'title' => 'Custom block types', - 'description' => 'Manage custom block types.', - 'route_name' => 'custom_block_type_list', + 'title' => 'Custom blocks', + 'description' => 'Manage custom blocks.', + 'route_name' => 'custom_block_list', ); $items['admin/structure/custom-blocks/list'] = array( - 'title' => 'Types', + 'title' => 'Blocks', 'type' => MENU_DEFAULT_LOCAL_TASK, ); - $items['admin/structure/custom-blocks/blocks'] = array( - 'title' => 'Blocks', - 'route_name' => 'custom_block_list', + $items['admin/structure/custom-blocks/types'] = array( + 'title' => 'Types', + 'route_name' => 'custom_block_type_list', 'type' => MENU_LOCAL_TASK, ); - $items['admin/structure/custom-blocks/add'] = array( + $items['admin/structure/custom-blocks/types/add'] = array( 'route_name' => 'custom_block_type_add', 'type' => MENU_SIBLING_LOCAL_TASK, 'weight' => 1, diff --git a/core/modules/block/custom_block/custom_block.pages.inc b/core/modules/block/custom_block/custom_block.pages.inc index ae7de30..68f3b78 100644 --- a/core/modules/block/custom_block/custom_block.pages.inc +++ b/core/modules/block/custom_block/custom_block.pages.inc @@ -73,5 +73,5 @@ function custom_block_delete_form_submit($form, &$form_state) { drupal_set_message(t('Custom block %label has been deleted.', array('%label' => $block->label()))); watchdog('custom_block', 'Custom block %label has been deleted.', array('%label' => $block->label()), WATCHDOG_NOTICE); - $form_state['redirect'] = 'admin/structure/block'; + $form_state['redirect'] = 'admin/structure/custom-blocks'; } diff --git a/core/modules/block/custom_block/custom_block.routing.yml b/core/modules/block/custom_block/custom_block.routing.yml index 5cd197c..52e1575 100644 --- a/core/modules/block/custom_block/custom_block.routing.yml +++ b/core/modules/block/custom_block/custom_block.routing.yml @@ -1,5 +1,5 @@ custom_block_type_list: - pattern: '/admin/structure/custom-blocks' + pattern: '/admin/structure/custom-blocks/types' defaults: _entity_list: 'custom_block_type' requirements: @@ -35,7 +35,7 @@ custom_block_edit: custom_block: \d+ custom_block_type_add: - pattern: '/admin/structure/custom-blocks/add' + pattern: '/admin/structure/custom-blocks/types/add' defaults: _entity_form: 'custom_block_type.add' requirements: @@ -49,7 +49,7 @@ custom_block_type_edit: _entity_access: 'custom_block_type.update' custom_block_list: - pattern: '/admin/structure/custom-blocks/blocks' + pattern: '/admin/structure/custom-blocks' defaults: _entity_list: 'custom_block' requirements: diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php index cde78ae..fda13cd 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php @@ -182,17 +182,7 @@ public function save(array $form, array &$form_state) { if ($block->id->value) { $form_state['values']['id'] = $block->id->value; $form_state['id'] = $block->id->value; - if ($insert) { - if ($theme = $block->getTheme()) { - $form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . $theme; - } - else { - $form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . config('system.theme')->get('default'); - } - } - else { - $form_state['redirect'] = 'admin/structure/block'; - } + $form_state['redirect'] = 'admin/structure/custom-blocks'; } else { // In the unlikely case something went wrong on save, the block will be diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php index 8ff888a..8bf08f6 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockListController.php @@ -47,13 +47,4 @@ public function getOperations(EntityInterface $entity) { return $operations; } - /** - * {@inheritdoc} - */ - public function render() { - // @todo Remove this once https://drupal.org/node/1981644 is in. - drupal_set_title(t('Custom blocks')); - return parent::render(); - } - } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php index a98730e..06e92a5 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php @@ -101,7 +101,7 @@ public function save(array $form, array &$form_state) { watchdog('custom_block', 'Custom block type %label has been added.', array('%label' => $block_type->label()), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit')); } - $form_state['redirect'] = 'admin/structure/custom-blocks'; + $form_state['redirect'] = 'admin/structure/custom-blocks/types'; } /** diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php index aaf2676..e7b9c25 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php @@ -66,4 +66,13 @@ public function buildRow(EntityInterface $entity) { return $row; } + /** + * {@inheritdoc} + */ + public function render() { + // @todo Remove this once https://drupal.org/node/1981644 is in. + drupal_set_title(t('Custom block types')); + return parent::render(); + } + } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php index 7e595d2..4b7c220 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php @@ -60,7 +60,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelPath() { - return 'admin/structure/custom-blocks'; + return 'admin/structure/custom-blocks/types'; } /** @@ -90,7 +90,7 @@ public function buildForm(array $form, array &$form_state, Request $request = NU */ public function submit(array $form, array &$form_state) { $this->entity->delete(); - $form_state['redirect'] = 'admin/structure/custom-blocks'; + $form_state['redirect'] = 'admin/structure/custom-blocks/types'; drupal_set_message(t('Custom block type %label has been deleted.', array('%label' => $this->entity->label()))); watchdog('custom_block', 'Custom block type %label has been deleted.', array('%label' => $this->entity->label()), WATCHDOG_NOTICE); } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php index e7605a3..de6ddec 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php @@ -38,7 +38,6 @@ public static function getInfo() { public function testListing() { $this->drupalLogin($this->drupalCreateUser(array('administer blocks'))); $this->drupalGet('admin/structure/custom-blocks'); - $this->clickLink(t('Blocks')); // Test for the page title. $this->assertTitle('Custom blocks | Drupal'); @@ -69,7 +68,6 @@ public function testListing() { // Confirm that once the user returns to the listing, the text of the label // (versus elsewhere on the page). - $this->drupalGet('admin/structure/custom-blocks/blocks'); $this->assertFieldByXpath('//td', 'Antelope', "Label found for added block."); @@ -92,7 +90,6 @@ public function testListing() { // Confirm that once the user returns to the listing, the text of the label // (versus elsewhere on the page). - $this->drupalGet('admin/structure/custom-blocks/blocks'); $this->assertFieldByXpath('//td', 'Albatross', "Label found for updated 'Albatross' entity."); // Delete the added entity using the operations link. @@ -101,7 +98,6 @@ public function testListing() { $this->assertResponse(200); $this->assertTitle('Are you sure you want to delete Albatross? | Drupal'); $this->drupalPost(NULL, array(), t('Delete')); - $this->drupalGet('admin/structure/custom-blocks/blocks'); // Verify that the text of the label and machine name does not appear in // the list (though it may appear elsewhere on the page). diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php index 37dbf79..4e8c7d6 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php @@ -61,7 +61,7 @@ public function testCustomBlockTypeCreation() { 'id' => 'foo', 'label' => 'title for foo', ); - $this->drupalPost('admin/structure/custom-blocks/add', $edit, t('Save')); + $this->drupalPost('admin/structure/custom-blocks/types/add', $edit, t('Save')); $block_type = entity_load('custom_block_type', 'foo'); $this->assertTrue($block_type, 'The new block type has been created.');