diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 08c35c7..afdfcb0 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -274,9 +274,12 @@ public function url($rel = 'canonical', $options = array()) { * An array of URI placeholders. */ protected function urlRouteParameters($rel) { - // The entity ID is needed as a route parameter. - $uri_route_parameters[$this->getEntityTypeId()] = $this->id(); + $uri_route_parameters = []; + if ($rel != 'collection') { + // The entity ID is needed as a route parameter. + $uri_route_parameters[$this->getEntityTypeId()] = $this->id(); + } return $uri_route_parameters; } diff --git a/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php b/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php index ba47197..ef47ef5 100644 --- a/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php +++ b/core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php @@ -21,7 +21,7 @@ * However, for links enclosed in translatable text you should use t() and * embed the HTML anchor tag directly in the translated string. For example: * @code - * t('Visit the content types page', array('@url' => \Drupal::url('node.overview_types'))); + * t('Visit the content types page', array('@url' => \Drupal::url('entity.node_type.collection'))); * @endcode * This keeps the context of the link title ('settings' in the example) for * translators. diff --git a/core/modules/action/action.info.yml b/core/modules/action/action.info.yml index e99997d..7559efb 100644 --- a/core/modules/action/action.info.yml +++ b/core/modules/action/action.info.yml @@ -4,4 +4,4 @@ description: 'Perform tasks on specific events triggered within the system.' package: Core version: VERSION core: 8.x -configure: action.admin +configure: entity.action.collection diff --git a/core/modules/action/action.links.menu.yml b/core/modules/action/action.links.menu.yml index fa56951..cd18014 100644 --- a/core/modules/action/action.links.menu.yml +++ b/core/modules/action/action.links.menu.yml @@ -1,5 +1,5 @@ action.admin: title: Actions description: 'Manage the actions defined for your site.' - route_name: action.admin + route_name: entity.action.collection parent: system.admin_config_system diff --git a/core/modules/action/action.links.task.yml b/core/modules/action/action.links.task.yml index 0ca4413..5a6a6e6 100644 --- a/core/modules/action/action.links.task.yml +++ b/core/modules/action/action.links.task.yml @@ -1,4 +1,4 @@ action.admin: - route_name: action.admin + route_name: entity.action.collection title: 'Manage actions' - base_route: action.admin + base_route: entity.action.collection diff --git a/core/modules/action/action.module b/core/modules/action/action.module index 22138ae..2fb412a 100644 --- a/core/modules/action/action.module +++ b/core/modules/action/action.module @@ -19,13 +19,13 @@ function action_help($route_name, RouteMatchInterface $route_match) { $output .= '
' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration and are listed here automatically. Advanced actions need to be created and configured before they can be used because they have options that need to be specified; for example, sending an email to a specified address or unpublishing content containing certain words. To create an advanced action, select the action from the drop-down list in the advanced action section below and click the Create button.') . '
'; return $output; @@ -45,5 +45,6 @@ function action_entity_type_build(array &$entity_types) { ->setFormClass('delete', 'Drupal\action\Form\ActionDeleteForm') ->setListBuilderClass('Drupal\action\ActionListBuilder') ->setLinkTemplate('delete-form', '/admin/config/system/actions/configure/{action}/delete') - ->setLinkTemplate('edit-form', '/admin/config/system/actions/configure/{action}'); + ->setLinkTemplate('edit-form', '/admin/config/system/actions/configure/{action}') + ->setLinkTemplate('collection', '/admin/config/system/actions'); } diff --git a/core/modules/action/action.routing.yml b/core/modules/action/action.routing.yml index c75ff23..acb533a 100644 --- a/core/modules/action/action.routing.yml +++ b/core/modules/action/action.routing.yml @@ -1,4 +1,4 @@ -action.admin: +entity.action.collection: path: '/admin/config/system/actions' defaults: _title: 'Actions' diff --git a/core/modules/action/src/ActionFormBase.php b/core/modules/action/src/ActionFormBase.php index e6f0c91..96bb63d 100644 --- a/core/modules/action/src/ActionFormBase.php +++ b/core/modules/action/src/ActionFormBase.php @@ -149,7 +149,7 @@ public function save(array $form, FormStateInterface $form_state) { $this->entity->save(); drupal_set_message($this->t('The action has been successfully saved.')); - $form_state->setRedirect('action.admin'); + $form_state->setRedirect('entity.action.collection'); } } diff --git a/core/modules/action/src/Form/ActionDeleteForm.php b/core/modules/action/src/Form/ActionDeleteForm.php index 86e5eef..93e47ab 100644 --- a/core/modules/action/src/Form/ActionDeleteForm.php +++ b/core/modules/action/src/Form/ActionDeleteForm.php @@ -34,7 +34,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('action.admin'); + return new Url('entity.action.collection'); } /** diff --git a/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php b/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php index 2aa448b..e69ba71 100644 --- a/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php +++ b/core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php @@ -25,7 +25,7 @@ protected function setUp() { * Tests local task existence. */ public function testActionLocalTasks() { - $this->assertLocalTasks('action.admin', array(array('action.admin'))); + $this->assertLocalTasks('entity.action.collection', array(array('action.admin'))); } } diff --git a/core/modules/block_content/block_content.info.yml b/core/modules/block_content/block_content.info.yml index e9e7afb..d32bda7 100644 --- a/core/modules/block_content/block_content.info.yml +++ b/core/modules/block_content/block_content.info.yml @@ -7,4 +7,4 @@ core: 8.x dependencies: - block - text -configure: block_content.list +configure: entity.block_content.collection diff --git a/core/modules/block_content/block_content.links.action.yml b/core/modules/block_content/block_content.links.action.yml index 735e374..d94ca3f 100644 --- a/core/modules/block_content/block_content.links.action.yml +++ b/core/modules/block_content/block_content.links.action.yml @@ -2,7 +2,7 @@ block_content_type_add: route_name: block_content.type_add title: 'Add custom block type' appears_on: - - block_content.type_list + - entity.block_content_type.collection block_content_add_action: route_name: block_content.add_page @@ -10,5 +10,5 @@ block_content_add_action: appears_on: - block.admin_display - block.admin_display_theme - - block_content.list + - entity.block_content.collection class: \Drupal\block_content\Plugin\Menu\LocalAction\BlockContentAddLocalAction diff --git a/core/modules/block_content/block_content.links.task.yml b/core/modules/block_content/block_content.links.task.yml index bc29ba6..2b88171 100644 --- a/core/modules/block_content/block_content.links.task.yml +++ b/core/modules/block_content/block_content.links.task.yml @@ -1,15 +1,15 @@ -block_content.list: +entity.block_content.collection: title: 'Custom block library' - route_name: block_content.list + route_name: entity.block_content.collection base_route: block.admin_display block_content.list_sub: title: Blocks - route_name: block_content.list - parent_id: block_content.list -block_content.type_list: + route_name: entity.block_content.collection + parent_id: entity.block_content.collection +entity.block_content_type.collection: title: Types - route_name: block_content.type_list - parent_id: block_content.list + route_name: entity.block_content_type.collection + parent_id: entity.block_content.collection weight: 1 entity.block_content.canonical: diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module index ac45e62..1a64878 100644 --- a/core/modules/block_content/block_content.module +++ b/core/modules/block_content/block_content.module @@ -17,21 +17,21 @@ function block_content_help($route_name, RouteMatchInterface $route_match) { case 'help.page.block_content': $output = ''; $output .= '' . t('The Custom Block module allows you to create blocks of content, which can be placed in regions throughout the website. Custom blocks can have fields; see the Field module help for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the Block module help page for details. For more information, see the online documentation for the Custom Block module.', array('!block-content' => \Drupal::url('block_content.list'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '
'; + $output .= '' . t('The Custom Block module allows you to create blocks of content, which can be placed in regions throughout the website. Custom blocks can have fields; see the Field module help for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the Block module help page for details. For more information, see the online documentation for the Custom Block module.', array('!block-content' => \Drupal::url('entity.block_content.collection'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '
'; $output .= '' . t('This page lists user-created blocks. These blocks are derived from block types. A block type can consist of different fields and display settings. From the block types tab you can manage these fields as well as create new block types.') . '
'; return $output; - case 'block_content.type_list': + case 'entity.block_content_type.collection': $output = '' . t('This page lists block types. A block type can consist of different fields and display settings. From here you can manage these fields as well as create new block types.') . '
'; return $output; diff --git a/core/modules/block_content/block_content.routing.yml b/core/modules/block_content/block_content.routing.yml index 6ab7937..1c78f0c 100644 --- a/core/modules/block_content/block_content.routing.yml +++ b/core/modules/block_content/block_content.routing.yml @@ -1,4 +1,4 @@ -block_content.type_list: +entity.block_content_type.collection: path: '/admin/structure/block/block-content/types' defaults: _entity_list: 'block_content_type' @@ -80,7 +80,7 @@ entity.block_content_type.edit_form: requirements: _entity_access: 'block_content_type.update' -block_content.list: +entity.block_content.collection: path: '/admin/structure/block/block-content' defaults: _title: 'Custom block library' diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php index 994d956..1b81be2 100644 --- a/core/modules/block_content/src/BlockContentForm.php +++ b/core/modules/block_content/src/BlockContentForm.php @@ -198,7 +198,7 @@ public function save(array $form, FormStateInterface $form_state) { ); } else { - $form_state->setRedirect('block_content.list'); + $form_state->setRedirectUrl($block->urlInfo('collection')); } } else { diff --git a/core/modules/block_content/src/BlockContentTypeForm.php b/core/modules/block_content/src/BlockContentTypeForm.php index 7e18e39..c0f9ec5 100644 --- a/core/modules/block_content/src/BlockContentTypeForm.php +++ b/core/modules/block_content/src/BlockContentTypeForm.php @@ -108,7 +108,7 @@ public function save(array $form, FormStateInterface $form_state) { $logger->notice('Custom block type %label has been added.', array('%label' => $block_type->label(), 'link' => $edit_link)); } - $form_state->setRedirect('block_content.type_list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index f3c4767..ef48ac6 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -42,6 +42,7 @@ * "canonical" = "/block/{block_content}", * "delete-form" = "/block/{block_content}/delete", * "edit-form" = "/block/{block_content}", + * "collection" = "/admin/structure/block/block-content", * }, * translatable = TRUE, * entity_keys = { diff --git a/core/modules/block_content/src/Entity/BlockContentType.php b/core/modules/block_content/src/Entity/BlockContentType.php index 586cc1e..81b64e9 100644 --- a/core/modules/block_content/src/Entity/BlockContentType.php +++ b/core/modules/block_content/src/Entity/BlockContentType.php @@ -36,7 +36,8 @@ * }, * links = { * "delete-form" = "/admin/structure/block/block-content/manage/{block_content_type}/delete", - * "edit-form" = "/admin/structure/block/block-content/manage/{block_content_type}" + * "edit-form" = "/admin/structure/block/block-content/manage/{block_content_type}", + * "collection" = "/admin/structure/block/block-content/types", * } * ) */ diff --git a/core/modules/block_content/src/Form/BlockContentDeleteForm.php b/core/modules/block_content/src/Form/BlockContentDeleteForm.php index 26e55f4..0778ee2 100644 --- a/core/modules/block_content/src/Form/BlockContentDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentDeleteForm.php @@ -58,7 +58,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); drupal_set_message($this->t('Custom block %label has been deleted.', array('%label' => $this->entity->label()))); $this->logger('block_content')->notice('Custom block %label has been deleted.', array('%label' => $this->entity->label())); - $form_state->setRedirect('block_content.list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php index 4c7d909..9b07b96 100644 --- a/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentTypeDeleteForm.php @@ -55,7 +55,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('block_content.type_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php index 1cf3bdc..86921ec 100644 --- a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php +++ b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php @@ -25,7 +25,7 @@ public function getOptions(RouteMatchInterface $route_match) { $options['query']['theme'] = $theme; } // Adds a destination on custom block listing. - if ($route_match->getRouteName() == 'block_content.list') { + if ($route_match->getRouteName() == 'entity.block_content.collection') { $options['query']['destination'] = 'admin/structure/block/block-content'; } return $options; diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index 60f1210..d59a25d 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -197,7 +197,7 @@ public function testsBlockContentAddTypes() { $this->drupalPostForm(NULL, $edit, t('Save')); $blocks = $storage->loadByProperties(array('info' => $edit['info[0][value]'])); if (!empty($blocks)) { - $this->assertUrl(\Drupal::url('block_content.list', array(), array('absolute' => TRUE))); + $this->assertUrl(\Drupal::url('entity.block_content.collection', array(), array('absolute' => TRUE))); } else { $this->fail('Could not load created block.'); diff --git a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php index 7f95e6b..83cbcf8 100644 --- a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php +++ b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php @@ -64,11 +64,11 @@ public function testBlockContentListLocalTasks($route) { $this->assertLocalTasks($route, array( 0 => array( 'block.admin_display', - 'block_content.list', + 'entity.block_content.collection', ), 1 => array( 'block_content.list_sub', - 'block_content.type_list', + 'entity.block_content_type.collection', ), )); } @@ -78,7 +78,7 @@ public function testBlockContentListLocalTasks($route) { */ public function getBlockContentListingRoutes() { return array( - array('block_content.list', 'block_content.type_list'), + array('entity.block_content.collection', 'entity.block_content_type.collection'), ); } diff --git a/core/modules/comment/comment.links.action.yml b/core/modules/comment/comment.links.action.yml index fc97d2d..6cd1f8b 100644 --- a/core/modules/comment/comment.links.action.yml +++ b/core/modules/comment/comment.links.action.yml @@ -2,4 +2,4 @@ comment_type_add: route_name: entity.comment_type.add_form title: 'Add comment type' appears_on: - - comment.type_list + - entity.comment_type.collection diff --git a/core/modules/comment/comment.links.menu.yml b/core/modules/comment/comment.links.menu.yml index e4d4488..8c81e68 100644 --- a/core/modules/comment/comment.links.menu.yml +++ b/core/modules/comment/comment.links.menu.yml @@ -3,8 +3,8 @@ comment.admin: route_name: comment.admin parent: system.admin_content description: 'List and edit site comments and the comment approval queue.' -comment.type_list: +entity.comment_type.collection: title: 'Comment types' - route_name: comment.type_list + route_name: entity.comment_type.collection parent: system.admin_structure description: 'Manage form and displays settings of comments.' diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index e4b674f..d60d30b 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -69,7 +69,7 @@ function comment_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('This page provides a list of all comment types on the site and allows you to manage the fields, form and display settings for each.') . '
'; return $output; } diff --git a/core/modules/comment/comment.routing.yml b/core/modules/comment/comment.routing.yml index a90f410..83af1c8 100644 --- a/core/modules/comment/comment.routing.yml +++ b/core/modules/comment/comment.routing.yml @@ -78,7 +78,7 @@ comment.node_redirect: _entity_access: 'node.view' _module_dependencies: 'node' -comment.type_list: +entity.comment_type.collection: path: '/admin/structure/comment' defaults: _entity_list: 'comment_type' diff --git a/core/modules/comment/src/CommentTypeForm.php b/core/modules/comment/src/CommentTypeForm.php index db9361a..3c7ef6a 100644 --- a/core/modules/comment/src/CommentTypeForm.php +++ b/core/modules/comment/src/CommentTypeForm.php @@ -173,7 +173,7 @@ public function save(array $form, FormStateInterface $form_state) { $this->logger->notice('Comment type %label has been added.', array('%label' => $comment_type->label(), 'link' => $edit_link)); } - $form_state->setRedirect('comment.type_list'); + $form_state->setRedirectUrl($comment_type->urlInfo('collection')); } } diff --git a/core/modules/comment/src/Entity/CommentType.php b/core/modules/comment/src/Entity/CommentType.php index 80a1aaa..fb41442 100644 --- a/core/modules/comment/src/Entity/CommentType.php +++ b/core/modules/comment/src/Entity/CommentType.php @@ -36,7 +36,8 @@ * links = { * "delete-form" = "/admin/structure/comment/manage/{comment_type}/delete", * "edit-form" = "/admin/structure/comment/manage/{comment_type}", - * "add-form" = "/admin/structure/comment/types/add" + * "add-form" = "/admin/structure/comment/types/add", + * "collection" = "/admin/structure/comment/types", * } * ) */ diff --git a/core/modules/comment/src/Form/CommentTypeDeleteForm.php b/core/modules/comment/src/Form/CommentTypeDeleteForm.php index 7ac7ce7..6fe26d4 100644 --- a/core/modules/comment/src/Form/CommentTypeDeleteForm.php +++ b/core/modules/comment/src/Form/CommentTypeDeleteForm.php @@ -99,7 +99,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('comment.type_list'); + return $this->entity->urlInfo('collection'); } /** @@ -143,7 +143,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); - $form_state->setRedirect('comment.type_list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); drupal_set_message($this->t('Comment type %label has been deleted.', array('%label' => $this->entity->label()))); $this->logger->notice('comment type %label has been deleted.', array('%label' => $this->entity->label())); } diff --git a/core/modules/config/tests/config_test/config_test.links.action.yml b/core/modules/config/tests/config_test/config_test.links.action.yml index 8e1e4a4..f70a790 100644 --- a/core/modules/config/tests/config_test/config_test.links.action.yml +++ b/core/modules/config/tests/config_test/config_test.links.action.yml @@ -2,4 +2,4 @@ config_test_entity_add_local_action: route_name: config_test.entity_add title: 'Add test configuration' appears_on: - - config_test.list_page + - entity.config_test.collection diff --git a/core/modules/config/tests/config_test/config_test.routing.yml b/core/modules/config/tests/config_test/config_test.routing.yml index 3a96481..569b601 100644 --- a/core/modules/config/tests/config_test/config_test.routing.yml +++ b/core/modules/config/tests/config_test/config_test.routing.yml @@ -1,4 +1,4 @@ -config_test.list_page: +entity.config_test.collection: path: '/admin/structure/config_test' defaults: _entity_list: 'config_test' diff --git a/core/modules/config/tests/config_test/src/ConfigTestController.php b/core/modules/config/tests/config_test/src/ConfigTestController.php index cb62642..a195a6e 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestController.php +++ b/core/modules/config/tests/config_test/src/ConfigTestController.php @@ -41,7 +41,7 @@ public function editTitle(ConfigTest $config_test) { */ function enable(ConfigTest $config_test) { $config_test->enable()->save(); - return new RedirectResponse($this->url('config_test.list_page', array(), array('absolute' => TRUE))); + return new RedirectResponse($config_test->url('collection', array('absolute' => TRUE))); } /** @@ -55,7 +55,7 @@ function enable(ConfigTest $config_test) { */ function disable(ConfigTest $config_test) { $config_test->disable()->save(); - return new RedirectResponse(\Drupal::url('config_test.list_page', array(), array('absolute' => TRUE))); + return new RedirectResponse($config_test->url('collection', array('absolute' => TRUE))); } } diff --git a/core/modules/config/tests/config_test/src/ConfigTestForm.php b/core/modules/config/tests/config_test/src/ConfigTestForm.php index cb847ee..e77ddb0 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestForm.php +++ b/core/modules/config/tests/config_test/src/ConfigTestForm.php @@ -81,7 +81,7 @@ public function save(array $form, FormStateInterface $form_state) { drupal_set_message(format_string('%label configuration has been created.', array('%label' => $entity->label()))); } - $form_state->setRedirect('config_test.list_page'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php index d9b69df..e27fc16 100644 --- a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php @@ -37,7 +37,8 @@ * "edit-form" = "/admin/structure/config_test/manage/{config_test}", * "delete-form" = "/admin/structure/config_test/manage/{config_test}/delete", * "enable" = "/admin/structure/config_test/manage/{config_test}/enable", - * "disable" = "/admin/structure/config_test/manage/{config_test}/disable" + * "disable" = "/admin/structure/config_test/manage/{config_test}/disable", + * "collection" = "/admin/structure/config_test", * } * ) */ diff --git a/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php b/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php index 76fc67e..05d9dc2 100644 --- a/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php +++ b/core/modules/config/tests/config_test/src/Form/ConfigTestDeleteForm.php @@ -34,7 +34,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('config_test.list_page'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 3655d49..ea4e532 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -23,7 +23,7 @@ function config_translation_help($route_name, RouteMatchInterface $route_match) $output .= '' . t('Add one or more forms on this page to set up your site-wide contact form.', array('@form' => \Drupal::url('contact.site_page'))) . '
'; - $output .= '' . t('A Contact menu item is added to the Footer menu, which you can modify on the Menus administration page.', array('@menu-settings' => \Drupal::url('menu_ui.overview_page'))) . '
'; + $output .= '' . t('A Contact menu item is added to the Footer menu, which you can modify on the Menus administration page.', array('@menu-settings' => \Drupal::url('entity.menu.collection'))) . '
'; $output .= '' . t('If you would like additional text to appear on the site-wide contact page, use a block. You can create and edit blocks on the Blocks administration page.', array('@blocks' => \Drupal::url('block.admin_display'))) . '
'; return $output; } diff --git a/core/modules/contact/contact.routing.yml b/core/modules/contact/contact.routing.yml index 876157d..2608a37 100644 --- a/core/modules/contact/contact.routing.yml +++ b/core/modules/contact/contact.routing.yml @@ -6,7 +6,7 @@ entity.contact_form.delete_form: requirements: _entity_access: 'contact_form.delete' -contact.form_list: +entity.contact_form.collection: path: '/admin/structure/contact' defaults: _entity_list: 'contact_form' diff --git a/core/modules/contact/src/ContactFormEditForm.php b/core/modules/contact/src/ContactFormEditForm.php index 123ba38..15944b6 100644 --- a/core/modules/contact/src/ContactFormEditForm.php +++ b/core/modules/contact/src/ContactFormEditForm.php @@ -119,7 +119,7 @@ public function save(array $form, FormStateInterface $form_state) { ->save(); } - $form_state->setRedirect('contact.form_list'); + $form_state->setRedirectUrl($contact_form->urlInfo('collection')); } } diff --git a/core/modules/contact/src/Entity/ContactForm.php b/core/modules/contact/src/Entity/ContactForm.php index c6ffdaf..febc536 100644 --- a/core/modules/contact/src/Entity/ContactForm.php +++ b/core/modules/contact/src/Entity/ContactForm.php @@ -35,7 +35,8 @@ * }, * links = { * "delete-form" = "/admin/structure/contact/manage/{contact_form}/delete", - * "edit-form" = "/admin/structure/contact/manage/{contact_form}" + * "edit-form" = "/admin/structure/contact/manage/{contact_form}", + * "collection" = "/admin/structure/contact", * } * ) */ diff --git a/core/modules/contact/src/Form/ContactFormDeleteForm.php b/core/modules/contact/src/Form/ContactFormDeleteForm.php index a036f2e..1333305 100644 --- a/core/modules/contact/src/Form/ContactFormDeleteForm.php +++ b/core/modules/contact/src/Form/ContactFormDeleteForm.php @@ -27,7 +27,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('contact.form_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/content_translation/content_translation.install b/core/modules/content_translation/content_translation.install index 34d2717..c6e173b 100644 --- a/core/modules/content_translation/content_translation.install +++ b/core/modules/content_translation/content_translation.install @@ -96,7 +96,7 @@ function content_translation_install() { function content_translation_enable() { // Translation works when at least two languages are added. if (count(\Drupal::languageManager()->getLanguages()) < 2) { - $t_args = array('!language_url' => \Drupal::url('language.admin_overview')); + $t_args = array('!language_url' => \Drupal::url('entity.configurable_language.collection')); $message = t('Be sure to add at least two languages to translate content.', $t_args); drupal_set_message($message, 'warning'); } diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index f1d01ef..40a41fa 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -25,7 +25,7 @@ function content_translation_help($route_name, RouteMatchInterface $route_match) $output .= '' . t('This list shows all fields currently in use for easy reference.') . '
'; } } @@ -88,6 +88,7 @@ function field_ui_entity_type_build(array &$entity_types) { $entity_types['field_config']->setFormClass('delete', 'Drupal\field_ui\Form\FieldConfigDeleteForm'); $entity_types['field_config']->setListBuilderClass('Drupal\field_ui\FieldConfigListBuilder'); $entity_types['field_storage_config']->setListBuilderClass('Drupal\field_ui\FieldStorageConfigListBuilder'); + $entity_types['field_storage_config']->setLinkTemplate('collection', '/admin/reports/fields'); foreach ($entity_types as $entity_type) { if ($bundle = $entity_type->getBundleOf()) { @@ -306,6 +307,7 @@ function field_ui_entity_type_alter(array &$entity_types) { $form_mode->set('admin_permission', 'administer display modes'); $form_mode->setLinkTemplate('delete-form', '/admin/structure/display-modes/form/manage/{entity_form_mode}/delete'); $form_mode->setLinkTemplate('edit-form', '/admin/structure/display-modes/form/manage/{entity_form_mode}'); + $form_mode->setLinkTemplate('collection', '/admin/structure/display-modes/form'); $view_mode = $entity_types['entity_view_mode']; $view_mode->setListBuilderClass('Drupal\field_ui\EntityDisplayModeListBuilder'); @@ -315,4 +317,5 @@ function field_ui_entity_type_alter(array &$entity_types) { $view_mode->set('admin_permission', 'administer display modes'); $view_mode->setLinkTemplate('delete-form', '/admin/structure/display-modes/view/manage/{entity_view_mode}/delete'); $view_mode->setLinkTemplate('edit-form', '/admin/structure/display-modes/view/manage/{entity_view_mode}'); + $view_mode->setLinkTemplate('collection', '/admin/structure/display-modes/view'); } diff --git a/core/modules/field_ui/field_ui.routing.yml b/core/modules/field_ui/field_ui.routing.yml index b7ab5b5..22b8c7b 100644 --- a/core/modules/field_ui/field_ui.routing.yml +++ b/core/modules/field_ui/field_ui.routing.yml @@ -1,4 +1,4 @@ -field_ui.list: +entity.field_storage_config.collection: path: '/admin/reports/fields' defaults: _entity_list: 'field_storage_config' @@ -14,7 +14,7 @@ field_ui.display_mode: requirements: _permission: 'administer display modes' -field_ui.entity_view_mode_list: +entity.entity_view_mode.collection: path: '/admin/structure/display-modes/view' defaults: _entity_list: 'entity_view_mode' @@ -54,7 +54,7 @@ entity.entity_view_mode.delete_form: requirements: _entity_access: 'entity_view_mode.delete' -field_ui.entity_form_mode_list: +entity.entity_form_mode.collection: path: '/admin/structure/display-modes/form' defaults: _entity_list: 'entity_form_mode' diff --git a/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php b/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php index 315c918..f50dbe6 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php +++ b/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides the delete form for entity display modes. @@ -20,7 +19,7 @@ class EntityDisplayModeDeleteForm extends EntityConfirmFormBase { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('field_ui.' . $this->entity->getEntityTypeId() . '_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php index 9b7fdd2..0bdce49 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php +++ b/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php @@ -125,7 +125,7 @@ public function save(array $form, FormStateInterface $form_state) { drupal_set_message(t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel()))); $this->entity->save(); \Drupal::entityManager()->clearCachedFieldDefinitions(); - $form_state->setRedirect('field_ui.' . $this->entity->getEntityTypeId() . '_list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/image/image.info.yml b/core/modules/image/image.info.yml index 4a704cc..6ce28ec 100644 --- a/core/modules/image/image.info.yml +++ b/core/modules/image/image.info.yml @@ -6,4 +6,4 @@ version: VERSION core: 8.x dependencies: - file -configure: image.style_list +configure: entity.image_style.collection diff --git a/core/modules/image/image.links.action.yml b/core/modules/image/image.links.action.yml index 134f3a8..2b3ce09 100644 --- a/core/modules/image/image.links.action.yml +++ b/core/modules/image/image.links.action.yml @@ -2,4 +2,4 @@ image_style_add_action: route_name: image.style_add title: 'Add image style' appears_on: - - image.style_list + - entity.image_style.collection diff --git a/core/modules/image/image.links.menu.yml b/core/modules/image/image.links.menu.yml index 02b60e8..235d01c 100644 --- a/core/modules/image/image.links.menu.yml +++ b/core/modules/image/image.links.menu.yml @@ -1,5 +1,5 @@ -image.style_list: +entity.image_style.collection: title: 'Image styles' description: 'Configure styles that can be used for resizing or adjusting images on display.' parent: system.admin_config_media - route_name: image.style_list + route_name: entity.image_style.collection diff --git a/core/modules/image/image.links.task.yml b/core/modules/image/image.links.task.yml index cf835eb..3e7a9af 100644 --- a/core/modules/image/image.links.task.yml +++ b/core/modules/image/image.links.task.yml @@ -3,7 +3,7 @@ entity.image_style.edit_form: route_name: entity.image_style.edit_form base_route: entity.image_style.edit_form -image.style_list: +entity.image_style.collection: title: List - route_name: image.style_list - base_route: image.style_list + route_name: entity.image_style.collection + base_route: entity.image_style.collection diff --git a/core/modules/image/image.module b/core/modules/image/image.module index a408e05..fd1099d 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -56,18 +56,18 @@ function image_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('Image styles commonly provide thumbnail sizes by scaling and cropping images, but can also add various effects before an image is displayed. When an image is displayed with a style, a new file is created and the original image is left unchanged.') . '
'; case 'image.effect_add_form': diff --git a/core/modules/image/image.routing.yml b/core/modules/image/image.routing.yml index 24b72d3..ffeed86 100644 --- a/core/modules/image/image.routing.yml +++ b/core/modules/image/image.routing.yml @@ -38,7 +38,7 @@ image.effect_delete: requirements: _permission: 'administer image styles' -image.style_list: +entity.image_style.collection: path: '/admin/config/media/image-styles' defaults: _entity_list: 'image_style' diff --git a/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php index a87554c..cf9c861 100644 --- a/core/modules/image/src/Entity/ImageStyle.php +++ b/core/modules/image/src/Entity/ImageStyle.php @@ -46,7 +46,8 @@ * links = { * "flush-form" = "/admin/config/media/image-styles/manage/{image_style}/flush", * "edit-form" = "/admin/config/media/image-styles/manage/{image_style}", - * "delete-form" = "/admin/config/media/image-styles/manage/{image_style}/delete" + * "delete-form" = "/admin/config/media/image-styles/manage/{image_style}/delete", + * "collection" = "/admin/config/media/image-styles", * } * ) */ diff --git a/core/modules/image/src/Form/ImageStyleDeleteForm.php b/core/modules/image/src/Form/ImageStyleDeleteForm.php index 65dddac..05939fb 100644 --- a/core/modules/image/src/Form/ImageStyleDeleteForm.php +++ b/core/modules/image/src/Form/ImageStyleDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Creates a form to delete an image style. @@ -34,7 +33,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('image.style_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/image/src/Form/ImageStyleFlushForm.php b/core/modules/image/src/Form/ImageStyleFlushForm.php index d5f0ea5..9cc5586 100644 --- a/core/modules/image/src/Form/ImageStyleFlushForm.php +++ b/core/modules/image/src/Form/ImageStyleFlushForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Form controller for image style flush. @@ -41,7 +40,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('image.style_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php index e9ab03e..b1913b1 100644 --- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php +++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php @@ -45,13 +45,6 @@ class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPlugi protected $linkGenerator; /** - * The url generator service. - * - * @var \Drupal\Core\Routing\UrlGeneratorInterface - */ - protected $urlGenerator; - - /** * Constructs an ImageFormatter object. * * @param string $plugin_id @@ -72,14 +65,11 @@ class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPlugi * The current user. * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator * The link generator service. - * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator - * The url generator service. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator, UrlGeneratorInterface $url_generator) { + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->currentUser = $current_user; $this->linkGenerator = $link_generator; - $this->urlGenerator = $url_generator; } /** @@ -95,8 +85,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration['view_mode'], $configuration['third_party_settings'], $container->get('current_user'), - $container->get('link_generator'), - $container->get('url_generator') + $container->get('link_generator') ); } @@ -122,7 +111,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) { '#empty_option' => t('None (original image)'), '#options' => $image_styles, '#description' => array( - '#markup' => $this->linkGenerator->generate($this->t('Configure Image Styles', array('@url' => $this->urlGenerator->generateFromRoute('image.style_list'))), new Url('image.style_list')), + '#markup' => $this->linkGenerator->generate($this->t('Configure Image Styles'), new Url('entity.image_style.collection')), '#access' => $this->currentUser->hasPermission('administer image styles'), ), ); diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php index f0b04cb..4fef5f5 100644 --- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php @@ -55,7 +55,7 @@ function _testImageFieldFormatters($scheme) { // Test for existence of link to image styles configuration. $this->drupalPostAjaxForm(NULL, array(), "{$field_name}_settings_edit"); - $this->assertLinkByHref(\Drupal::url('image.style_list'), 0, 'Link to image styles configuration is found'); + $this->assertLinkByHref(\Drupal::url('entity.image_style.collection'), 0, 'Link to image styles configuration is found'); // Remove 'administer image styles' permission from testing admin user. $admin_user_roles = $this->adminUser->getRoles(TRUE); @@ -66,7 +66,7 @@ function _testImageFieldFormatters($scheme) { // Test for absence of link to image styles configuration. $this->drupalPostAjaxForm(NULL, array(), "{$field_name}_settings_edit"); - $this->assertNoLinkByHref(\Drupal::url('image.style_list'), 'Link to image styles configuration is absent when permissions are insufficient'); + $this->assertNoLinkByHref(\Drupal::url('entity.image_style.collection'), 'Link to image styles configuration is absent when permissions are insufficient'); // Restore 'administer image styles' permission to testing admin user user_role_change_permissions(reset($admin_user_roles), array('administer image styles' => TRUE)); diff --git a/core/modules/language/language.info.yml b/core/modules/language/language.info.yml index c1cf7ff..3077040 100644 --- a/core/modules/language/language.info.yml +++ b/core/modules/language/language.info.yml @@ -4,4 +4,4 @@ description: 'Allows users to configure languages and apply them to content.' package: Multilingual version: VERSION core: 8.x -configure: language.admin_overview +configure: entity.configurable_language.collection diff --git a/core/modules/language/language.links.action.yml b/core/modules/language/language.links.action.yml index ad09aa1..18fd382 100644 --- a/core/modules/language/language.links.action.yml +++ b/core/modules/language/language.links.action.yml @@ -2,4 +2,4 @@ language_add_local_action: route_name: language.add title: 'Add language' appears_on: - - language.admin_overview + - entity.configurable_language.collection diff --git a/core/modules/language/language.links.menu.yml b/core/modules/language/language.links.menu.yml index 26f9f9a..3b01228 100644 --- a/core/modules/language/language.links.menu.yml +++ b/core/modules/language/language.links.menu.yml @@ -1,7 +1,7 @@ -language.admin_overview: +entity.configurable_language.collection: title: Languages description: 'Configure languages for content and the user interface.' - route_name: language.admin_overview + route_name: entity.configurable_language.collection parent: system.admin_config_regional language.content_settings_page: title: 'Content language' diff --git a/core/modules/language/language.links.task.yml b/core/modules/language/language.links.task.yml index 76f5406..e9b6ca5 100644 --- a/core/modules/language/language.links.task.yml +++ b/core/modules/language/language.links.task.yml @@ -1,11 +1,11 @@ -language.admin_overview: +entity.configurable_language.collection: title: 'List' - route_name: language.admin_overview - base_route: language.admin_overview + route_name: entity.configurable_language.collection + base_route: entity.configurable_language.collection language.negotiation: title: 'Detection and selection' route_name: language.negotiation - base_route: language.admin_overview + base_route: entity.configurable_language.collection entity.configurable_language.edit_form: title: 'Edit' diff --git a/core/modules/language/language.module b/core/modules/language/language.module index ddf5804..ce23afc 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -32,7 +32,7 @@ function language_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('Reorder the added languages to set their order in the language switcher block and, when editing content, in the list of selectable languages. This ordering does not impact detection and selection.', array('@detection' => \Drupal::url('language.negotiation'))) . '
'; case 'language.add': @@ -69,11 +69,11 @@ function language_help($route_name, RouteMatchInterface $route_match) { return $output; case 'language.negotiation_browser': - $output = '' . t('Browsers use different language codes to refer to the same languages. Internally, a best effort is made to determine the correct language based on the code that the browser sends. You can add and edit additional mappings from browser language codes to site languages.', array('!configure-languages' => \Drupal::url('language.admin_overview'))) . '
'; + $output = '' . t('Browsers use different language codes to refer to the same languages. Internally, a best effort is made to determine the correct language based on the code that the browser sends. You can add and edit additional mappings from browser language codes to site languages.', array('!configure-languages' => \Drupal::url('entity.configurable_language.collection'))) . '
'; return $output; case 'language.negotiation_selected': - $output = '' . t('Changing the selected language here (and leaving this option as the last among the detection and selection options) is the easiest way to change the fallback language for the website, if you need to change how your site works by default (e.g., when using an empty path prefix or using the default domain). Changing the site\'s default language itself might have other undesired side effects.', array('!admin-change-language' => \Drupal::url('language.admin_overview'))) . '
'; + $output = '' . t('Changing the selected language here (and leaving this option as the last among the detection and selection options) is the easiest way to change the fallback language for the website, if you need to change how your site works by default (e.g., when using an empty path prefix or using the default domain). Changing the site\'s default language itself might have other undesired side effects.', array('!admin-change-language' => \Drupal::url('entity.configurable_language.collection'))) . '
'; return $output; case 'entity.block.edit_form': diff --git a/core/modules/language/language.routing.yml b/core/modules/language/language.routing.yml index 4d78d6d..d21941d 100644 --- a/core/modules/language/language.routing.yml +++ b/core/modules/language/language.routing.yml @@ -38,7 +38,7 @@ entity.configurable_language.edit_form: requirements: _entity_access: 'configurable_language.update' -language.admin_overview: +entity.configurable_language.collection: path: '/admin/config/regional/language' defaults: _entity_list: 'configurable_language' diff --git a/core/modules/language/src/Element/LanguageConfiguration.php b/core/modules/language/src/Element/LanguageConfiguration.php index ad998f7..02c1788 100644 --- a/core/modules/language/src/Element/LanguageConfiguration.php +++ b/core/modules/language/src/Element/LanguageConfiguration.php @@ -47,7 +47,7 @@ public static function processLanguageConfiguration(&$element, FormStateInterfac '#type' => 'select', '#title' => t('Default language'), '#options' => $options + static::getDefaultOptions(), - '#description' => t('Explanation of the language options is found on the languages list page.', array('@languages_list_page' => \Drupal::url('language.admin_overview'))), + '#description' => t('Explanation of the language options is found on the languages list page.', array('@languages_list_page' => \Drupal::url('entity.configurable_language.collection'))), '#default_value' => ($default_config != NULL) ? $default_config->getDefaultLangcode() : LanguageInterface::LANGCODE_SITE_DEFAULT, ); diff --git a/core/modules/language/src/Entity/ConfigurableLanguage.php b/core/modules/language/src/Entity/ConfigurableLanguage.php index f2e128b..dfce85f 100644 --- a/core/modules/language/src/Entity/ConfigurableLanguage.php +++ b/core/modules/language/src/Entity/ConfigurableLanguage.php @@ -39,7 +39,8 @@ * }, * links = { * "delete-form" = "/admin/config/regional/language/delete/{configurable_language}", - * "edit-form" = "/admin/config/regional/language/edit/{configurable_language}" + * "edit-form" = "/admin/config/regional/language/edit/{configurable_language}", + * "collection" = "/admin/config/regional/language", * } * ) */ diff --git a/core/modules/language/src/Form/LanguageAddForm.php b/core/modules/language/src/Form/LanguageAddForm.php index 93f1445..0e7d04e 100644 --- a/core/modules/language/src/Form/LanguageAddForm.php +++ b/core/modules/language/src/Form/LanguageAddForm.php @@ -97,7 +97,7 @@ public function save(array $form, FormStateInterface $form_state) { // to their theme so they can switch between the languages. drupal_set_message($this->t('Use one of the language switcher blocks to allow site visitors to switch between languages. You can enable these blocks on the block administration page.', array('@block-admin' => $this->url('block.admin_display')))); } - $form_state->setRedirect('language.admin_overview'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } /** diff --git a/core/modules/language/src/Form/LanguageDeleteForm.php b/core/modules/language/src/Form/LanguageDeleteForm.php index 9f96673..8bdea12 100644 --- a/core/modules/language/src/Form/LanguageDeleteForm.php +++ b/core/modules/language/src/Form/LanguageDeleteForm.php @@ -10,11 +10,9 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\UrlGeneratorInterface; -use Drupal\Core\Url; use Drupal\Core\Language\LanguageManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -70,7 +68,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('language.admin_overview'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/language/src/Form/LanguageEditForm.php b/core/modules/language/src/Form/LanguageEditForm.php index 58b9951..79a3a17 100644 --- a/core/modules/language/src/Form/LanguageEditForm.php +++ b/core/modules/language/src/Form/LanguageEditForm.php @@ -49,7 +49,7 @@ public function actions(array $form, FormStateInterface $form_state) { */ public function save(array $form, FormStateInterface $form_state) { parent::save($form, $form_state); - $form_state->setRedirect('language.admin_overview'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); $this->logger('language')->notice('The %language (%langcode) language has been updated.', array('%language' => $this->entity->label(), '%langcode' => $this->entity->id())); } diff --git a/core/modules/language/src/Tests/LanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageConfigurationTest.php index 27abc6b..9a43437 100644 --- a/core/modules/language/src/Tests/LanguageConfigurationTest.php +++ b/core/modules/language/src/Tests/LanguageConfigurationTest.php @@ -43,7 +43,7 @@ function testLanguageConfiguration() { ); $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language'); $this->assertText('French'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); // Langcode for Languages is always 'en'. $language = $this->config('language.entity.fr')->get(); $this->assertEqual($language['langcode'], 'en'); diff --git a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php index a4878d3..fb74878 100644 --- a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php +++ b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php @@ -76,7 +76,7 @@ public function testLanguageConfiguration() { 'The language %language has been created and can now be used.', array('%language' => $edit['label']) )); - $this->assertUrl(\Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); // Test validation of existing language values. $edit = array( @@ -92,7 +92,7 @@ public function testLanguageConfiguration() { 'The language %language has been created and can now be used.', array('%language' => $edit['label']) )); - $this->assertUrl(\Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', array(), array('absolute' => TRUE)), [], 'Correct page redirection.'); // Add the language a second time and confirm that this is not allowed. $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); diff --git a/core/modules/language/src/Tests/LanguageListTest.php b/core/modules/language/src/Tests/LanguageListTest.php index c27f981..52f6e4c 100644 --- a/core/modules/language/src/Tests/LanguageListTest.php +++ b/core/modules/language/src/Tests/LanguageListTest.php @@ -41,7 +41,7 @@ function testLanguageList() { ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); $this->assertText('French', 'Language added successfully.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); // Add custom language. $langcode = 'xx'; @@ -53,7 +53,7 @@ function testLanguageList() { 'direction' => Language::DIRECTION_LTR, ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); $this->assertRaw('"edit-languages-' . $langcode .'-weight"', 'Language code found.'); $this->assertText(t($name), 'Test language added.'); @@ -75,7 +75,7 @@ function testLanguageList() { // Ensure we can't delete the default language. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $language])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $language])); $this->assertText(t('The default language cannot be deleted.'), 'Failed to delete the default language.'); // Ensure 'Edit' link works. @@ -88,7 +88,7 @@ function testLanguageList() { ); $this->drupalPostForm('admin/config/regional/language/edit/' . $langcode, $edit, t('Save language')); $this->assertRaw($name, 'The language has been updated.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $language])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $language])); // Change back the default language. $edit = array( @@ -104,7 +104,7 @@ function testLanguageList() { $this->drupalGet('admin/config/regional/language/delete/' . $langcode); // First test the 'cancel' link. $this->clickLink(t('Cancel')); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $english])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $english])); $this->assertRaw($name, 'The language was not deleted.'); // Delete the language for real. This a confirm form, we do not need any // fields changed. @@ -112,7 +112,7 @@ function testLanguageList() { // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => $name, '%langcode' => $langcode); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The test language has been removed.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE, 'language' => $english])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $english])); // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); $this->assertResponse(404, 'Language no longer found.'); @@ -124,7 +124,7 @@ function testLanguageList() { // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => 'French', '%langcode' => 'fr'); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The French language has been removed.'); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/fr'); $this->assertResponse(404, 'Language no longer found.'); @@ -142,7 +142,7 @@ function testLanguageList() { 'direction' => Language::DIRECTION_LTR, ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); - $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE])); + $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE])); $this->assertText($name, 'Name found.'); // Check if we can change the default language. diff --git a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php index dd1eff6..6e35abb 100644 --- a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php +++ b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php @@ -37,8 +37,8 @@ public function testLanguageAdminLocalTasks($route, $expected) { */ public function getLanguageAdminOverviewRoutes() { return array( - array('language.admin_overview', array(array('language.admin_overview', 'language.negotiation'))), - array('language.negotiation', array(array('language.admin_overview', 'language.negotiation'))), + array('entity.configurable_language.collection', array(array('entity.configurable_language.collection', 'language.negotiation'))), + array('language.negotiation', array(array('entity.configurable_language.collection', 'language.negotiation'))), ); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 9e09a46..bae2054 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -149,15 +149,15 @@ function locale_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. The report Available translation updates shows the status. Interface text can be customized in the user interface translation page.', array('!update' => \Drupal::url('locale.translate_status'), '!translate' => \Drupal::url('locale.translate_page'))) . '
'; case 'locale.translate_page': @@ -165,7 +165,7 @@ function locale_help($route_name, RouteMatchInterface $route_match) { return $output; case 'locale.translate_import': - $output = '' . t('Translation files are automatically downloaded and imported when languages are added, or when modules or themes are enabled.', array('!language' => \Drupal::url('language.admin_overview'))) . '
'; + $output = '' . t('Translation files are automatically downloaded and imported when languages are added, or when modules or themes are enabled.', array('!language' => \Drupal::url('entity.configurable_language.collection'))) . '
'; $output .= '' . t('This page allows translators to manually import translated strings contained in a Gettext Portable Object (.po) file. Manual import may be used for customized translations or for the translation of custom modules and themes. To customize translations you can download a translation file from the Drupal translation server or export translations from the site, customize the translations using a Gettext translation editor, and import the result using this page.', array('!url' => 'https://localize.drupal.org', '!export' => \Drupal::url('locale.translate_export'))) . '
'; $output .= '' . t('Note that importing large .po files may take several minutes.') . '
'; return $output; diff --git a/core/modules/locale/src/Form/TranslationStatusForm.php b/core/modules/locale/src/Form/TranslationStatusForm.php index b779ca7..ee07029 100644 --- a/core/modules/locale/src/Form/TranslationStatusForm.php +++ b/core/modules/locale/src/Form/TranslationStatusForm.php @@ -135,7 +135,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { if (!$languages) { $empty = $this->t('No translatable languages available. Add a language first.', array( - '@add_language' => $this->url('language.admin_overview'), + '@add_language' => $this->url('entity.configurable_language.collection'), )); } elseif ($status) { diff --git a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php index 248e35c..d26a070 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php +++ b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php @@ -45,7 +45,7 @@ public function testInterface() { $this->assertNoText(t('Translation update status'), 'No status message'); $this->drupalGet('admin/reports/translations'); - $this->assertRaw(t('No translatable languages available. Add a language first.', array('@add_language' => \Drupal::url('language.admin_overview'))), 'Language message'); + $this->assertRaw(t('No translatable languages available. Add a language first.', array('@add_language' => \Drupal::url('entity.configurable_language.collection'))), 'Language message'); // Add German language. $this->addLanguage('de'); diff --git a/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php b/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php index a876fb3..65404e8 100644 --- a/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php +++ b/core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php @@ -56,7 +56,7 @@ protected function getAdministratorPermissions() { */ protected function createEntity($values, $langcode, $bundle_name = NULL) { $values['menu_name'] = 'tools'; - $values['route_name'] = 'menu_ui.overview_page'; + $values['route_name'] = 'entity.menu.collection'; $values['title'] = 'Test title'; return parent::createEntity($values, $langcode, $bundle_name); diff --git a/core/modules/menu_ui/menu_ui.info.yml b/core/modules/menu_ui/menu_ui.info.yml index f3bf1be..5ac594e 100644 --- a/core/modules/menu_ui/menu_ui.info.yml +++ b/core/modules/menu_ui/menu_ui.info.yml @@ -4,6 +4,6 @@ description: 'Allows administrators to customize the site navigation menu.' package: Core version: VERSION core: 8.x -configure: menu_ui.overview_page +configure: entity.menu.collection dependencies: - menu_link_content diff --git a/core/modules/menu_ui/menu_ui.links.action.yml b/core/modules/menu_ui/menu_ui.links.action.yml index 848bcbe..c82f1ea 100644 --- a/core/modules/menu_ui/menu_ui.links.action.yml +++ b/core/modules/menu_ui/menu_ui.links.action.yml @@ -9,4 +9,4 @@ entity.menu.add_form: route_name: entity.menu.add_form title: 'Add menu' appears_on: - - menu_ui.overview_page + - entity.menu.collection diff --git a/core/modules/menu_ui/menu_ui.links.menu.yml b/core/modules/menu_ui/menu_ui.links.menu.yml index 0302335..6142abe 100644 --- a/core/modules/menu_ui/menu_ui.links.menu.yml +++ b/core/modules/menu_ui/menu_ui.links.menu.yml @@ -1,5 +1,5 @@ -menu_ui.overview_page: +entity.menu.collection: title: Menus description: 'Add new menus to your site, edit existing menus, and rename and reorganize menu links.' - route_name: menu_ui.overview_page + route_name: entity.menu.collection parent: system.admin_structure diff --git a/core/modules/menu_ui/menu_ui.links.task.yml b/core/modules/menu_ui/menu_ui.links.task.yml index 10dd8d0..5fa7af2 100644 --- a/core/modules/menu_ui/menu_ui.links.task.yml +++ b/core/modules/menu_ui/menu_ui.links.task.yml @@ -3,7 +3,7 @@ entity.menu.edit_form: route_name: entity.menu.edit_form base_route: entity.menu.edit_form -menu_ui.overview_page: +entity.menu.collection: title: 'List' - route_name: menu_ui.overview_page - base_route: menu_ui.overview_page + route_name: entity.menu.collection + base_route: entity.menu.collection diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index 3656e5f..14975f1 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -39,7 +39,7 @@ function menu_ui_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('You can enable the newly-created block for this menu on the Block layout page.', array('!blocks' => \Drupal::url('block.admin_display'))) . '
'; } - elseif ($route_name == 'menu_ui.overview_page' && \Drupal::moduleHandler()->moduleExists('block')) { + elseif ($route_name == 'entity.menu.collection' && \Drupal::moduleHandler()->moduleExists('block')) { return '' . t('Each menu has a corresponding block that is managed on the Block layout page.', array('!blocks' => \Drupal::url('block.admin_display'))) . '
'; } } @@ -66,7 +66,8 @@ function menu_ui_entity_type_build(array &$entity_types) { ->setLinkTemplate('add-form', '/admin/structure/menu/add') ->setLinkTemplate('delete-form', '/admin/structure/menu/manage/{menu}/delete') ->setLinkTemplate('edit-form', '/admin/structure/menu/manage/{menu}') - ->setLinkTemplate('add-link-form', '/admin/structure/menu/manage/{menu}/add'); + ->setLinkTemplate('add-link-form', '/admin/structure/menu/manage/{menu}/add') + ->setLinkTemplate('collection', '/admin/structure/menu'); } /** diff --git a/core/modules/menu_ui/menu_ui.routing.yml b/core/modules/menu_ui/menu_ui.routing.yml index 97fd744..7f94a6d 100644 --- a/core/modules/menu_ui/menu_ui.routing.yml +++ b/core/modules/menu_ui/menu_ui.routing.yml @@ -1,4 +1,4 @@ -menu_ui.overview_page: +entity.menu.collection: path: '/admin/structure/menu' defaults: _entity_list: 'menu' diff --git a/core/modules/menu_ui/src/Form/MenuDeleteForm.php b/core/modules/menu_ui/src/Form/MenuDeleteForm.php index b289970..17185d0 100644 --- a/core/modules/menu_ui/src/Form/MenuDeleteForm.php +++ b/core/modules/menu_ui/src/Form/MenuDeleteForm.php @@ -93,7 +93,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $form_state->setRedirect('menu_ui.overview_page'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); // Locked menus may not be deleted. if ($this->entity->isLocked()) { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php index f87c013..e3c1c0d 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php @@ -13,7 +13,7 @@ use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; /** - * Upgrade variables to search.settings.yml. + * Upgrade variables to search.settings. * * @group migrate_drupal */ @@ -43,7 +43,7 @@ protected function setUp() { } /** - * Tests migration of search variables to search.settings.yml. + * Tests migration of search variables to search.settings. */ public function testSearchSettings() { $config = $this->config('search.settings'); diff --git a/core/modules/node/node.info.yml b/core/modules/node/node.info.yml index ab8e3c3..cdbef85 100644 --- a/core/modules/node/node.info.yml +++ b/core/modules/node/node.info.yml @@ -4,7 +4,7 @@ description: 'Allows content to be submitted to the site and displayed on pages. package: Core version: VERSION core: 8.x -configure: node.overview_types +configure: entity.node_type.collection dependencies: - text - entity_reference diff --git a/core/modules/node/node.links.action.yml b/core/modules/node/node.links.action.yml index b7b1577..22079cd 100644 --- a/core/modules/node/node.links.action.yml +++ b/core/modules/node/node.links.action.yml @@ -2,7 +2,7 @@ node.type_add: route_name: node.type_add title: 'Add content type' appears_on: - - node.overview_types + - entity.node_type.collection node.add_page: route_name: node.add_page title: 'Add content' diff --git a/core/modules/node/node.links.menu.yml b/core/modules/node/node.links.menu.yml index a197494..b4edf23 100644 --- a/core/modules/node/node.links.menu.yml +++ b/core/modules/node/node.links.menu.yml @@ -1,8 +1,8 @@ -node.overview_types: +entity.node_type.collection: title: 'Content types' parent: system.admin_structure description: 'Manage content types, including default status, front page promotion, comment settings, etc.' - route_name: node.overview_types + route_name: entity.node_type.collection node.add_page: title: 'Add content' route_name: node.add_page diff --git a/core/modules/node/node.links.task.yml b/core/modules/node/node.links.task.yml index 88271e8..7da46bf 100644 --- a/core/modules/node/node.links.task.yml +++ b/core/modules/node/node.links.task.yml @@ -20,7 +20,7 @@ entity.node_type.edit_form: title: 'Edit' route_name: entity.node_type.edit_form base_route: entity.node_type.edit_form -node.overview_types: +entity.node_type.collection: title: List - route_name: node.overview_types - base_route: node.overview_types + route_name: entity.node_type.collection + base_route: entity.node_type.collection diff --git a/core/modules/node/node.module b/core/modules/node/node.module index a82ba2e..6230cad 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -85,7 +85,7 @@ function node_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('A responsive image mapping associates an image style with each breakpoint defined by your theme.') . '
'; break; @@ -53,7 +53,7 @@ function responsive_image_menu() { 'title' => 'Responsive image mappings', 'description' => 'Manage responsive image mappings', 'weight' => 10, - 'route_name' => 'responsive_image.mapping_page', + 'route_name' => 'entity.responsive_image_mapping.collection', ); $items['admin/config/media/responsive-image-mapping/%responsive_image_mapping'] = array( 'title' => 'Edit responsive image mapping', diff --git a/core/modules/responsive_image/responsive_image.routing.yml b/core/modules/responsive_image/responsive_image.routing.yml index 09b14b5..2cf9926 100644 --- a/core/modules/responsive_image/responsive_image.routing.yml +++ b/core/modules/responsive_image/responsive_image.routing.yml @@ -1,4 +1,4 @@ -responsive_image.mapping_page: +entity.responsive_image_mapping.collection: path: '/admin/config/media/responsive-image-mapping' defaults: _entity_list: 'responsive_image_mapping' diff --git a/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php b/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php index f866656..87c0878 100644 --- a/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php +++ b/core/modules/responsive_image/src/Entity/ResponsiveImageMapping.php @@ -34,7 +34,8 @@ * }, * links = { * "edit-form" = "/admin/config/media/responsive-image-mapping/{responsive_image_mapping}", - * "duplicate-form" = "/admin/config/media/responsive-image-mapping/{responsive_image_mapping}/duplicate" + * "duplicate-form" = "/admin/config/media/responsive-image-mapping/{responsive_image_mapping}/duplicate", + * "collection" = "/admin/config/media/responsive-image-mapping", * } * ) */ diff --git a/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php index d5526b55..5384134 100644 --- a/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php +++ b/core/modules/responsive_image/src/Form/ResponsiveImageMappingDeleteForm.php @@ -24,7 +24,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('responsive_image.mapping_page'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php index 0ad61ca..1f47865 100644 --- a/core/modules/responsive_image/src/ResponsiveImageMappingForm.php +++ b/core/modules/responsive_image/src/ResponsiveImageMappingForm.php @@ -162,7 +162,7 @@ public function save(array $form, FormStateInterface $form_state) { ); } else { - $form_state->setRedirect('responsive_image.mapping_page'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/search/search.info.yml b/core/modules/search/search.info.yml index 4675b0b..97b7d3f 100644 --- a/core/modules/search/search.info.yml +++ b/core/modules/search/search.info.yml @@ -4,4 +4,4 @@ description: 'Enables site-wide keyword searching.' package: Core version: VERSION core: 8.x -configure: search.settings +configure: entity.search_page.collection diff --git a/core/modules/search/search.links.menu.yml b/core/modules/search/search.links.menu.yml index 2bb0a18..ea5cfab 100644 --- a/core/modules/search/search.links.menu.yml +++ b/core/modules/search/search.links.menu.yml @@ -2,9 +2,9 @@ search.view: title: Search route_name: search.view enabled: 0 -search.settings: +entity.search_page.collection: title: 'Search pages' parent: system.admin_config_search description: 'Configure search pages and search indexing options.' - route_name: search.settings + route_name: entity.search_page.collection weight: -10 diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 4e62b09..e05576d 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -78,10 +78,10 @@ function search_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the settings below.', array('!cron' => \Drupal::url('system.status'))) . '
'; } } diff --git a/core/modules/search/search.routing.yml b/core/modules/search/search.routing.yml index 479ebe8..ec273f1 100644 --- a/core/modules/search/search.routing.yml +++ b/core/modules/search/search.routing.yml @@ -1,4 +1,4 @@ -search.settings: +entity.search_page.collection: path: '/admin/config/search/pages' defaults: _entity_list: 'search_page' diff --git a/core/modules/search/src/Controller/SearchController.php b/core/modules/search/src/Controller/SearchController.php index 4e79f79..f3e0e06 100644 --- a/core/modules/search/src/Controller/SearchController.php +++ b/core/modules/search/src/Controller/SearchController.php @@ -191,7 +191,8 @@ public function performOperation(SearchPageInterface $search_page, $op) { drupal_set_message($this->t('The %label search page has been disabled.', array('%label' => $search_page->label()))); } - return $this->redirect('search.settings'); + $url = $search_page->urlInfo('collection'); + return $this->redirect($url->getRouteName(), $url->getRouteParameters(), $url->getOptions()); } /** @@ -208,7 +209,7 @@ public function setAsDefault(SearchPageInterface $search_page) { $this->searchPageRepository->setDefaultSearchPage($search_page); drupal_set_message($this->t('The default search page is now %label. Be sure to check the ordering of your search pages.', array('%label' => $search_page->label()))); - return $this->redirect('search.settings'); + return $this->redirect('entity.search_page.collection'); } } diff --git a/core/modules/search/src/Entity/SearchPage.php b/core/modules/search/src/Entity/SearchPage.php index 1ca1b54..4837906 100644 --- a/core/modules/search/src/Entity/SearchPage.php +++ b/core/modules/search/src/Entity/SearchPage.php @@ -39,7 +39,8 @@ * "delete-form" = "/admin/config/search/pages/manage/{search_page}/delete", * "enable" = "/admin/config/search/pages/manage/{search_page}/enable", * "disable" = "/admin/config/search/pages/manage/{search_page}/disable", - * "set-default" = "/admin/config/search/pages/manage/{search_page}/set-default" + * "set-default" = "/admin/config/search/pages/manage/{search_page}/set-default", + * "collection" = "/admin/config/search/pages", * }, * config_prefix = "page", * entity_keys = { diff --git a/core/modules/search/src/Form/ReindexConfirm.php b/core/modules/search/src/Form/ReindexConfirm.php index 84948a2..cc4194d 100644 --- a/core/modules/search/src/Form/ReindexConfirm.php +++ b/core/modules/search/src/Form/ReindexConfirm.php @@ -55,7 +55,7 @@ public function getCancelText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('search.settings'); + return new Url('entity.search_page.collection'); } /** diff --git a/core/modules/search/src/Form/SearchPageDeleteForm.php b/core/modules/search/src/Form/SearchPageDeleteForm.php index 5518d59..53974fb 100644 --- a/core/modules/search/src/Form/SearchPageDeleteForm.php +++ b/core/modules/search/src/Form/SearchPageDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a deletion confirm form for search. @@ -27,7 +26,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('search.settings'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/search/src/Form/SearchPageFormBase.php b/core/modules/search/src/Form/SearchPageFormBase.php index c2aa6ed..95afb4b 100644 --- a/core/modules/search/src/Form/SearchPageFormBase.php +++ b/core/modules/search/src/Form/SearchPageFormBase.php @@ -179,7 +179,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { public function save(array $form, FormStateInterface $form_state) { $this->entity->save(); - $form_state->setRedirect('search.settings'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/shortcut/shortcut.info.yml b/core/modules/shortcut/shortcut.info.yml index dde0e9c..f51d30b 100644 --- a/core/modules/shortcut/shortcut.info.yml +++ b/core/modules/shortcut/shortcut.info.yml @@ -4,4 +4,4 @@ description: 'Allows users to manage customizable lists of shortcut links.' package: Core version: VERSION core: 8.x -configure: shortcut.set_admin +configure: entity.shortcut_set.collection diff --git a/core/modules/shortcut/shortcut.links.action.yml b/core/modules/shortcut/shortcut.links.action.yml index 05b431a..23471d9 100644 --- a/core/modules/shortcut/shortcut.links.action.yml +++ b/core/modules/shortcut/shortcut.links.action.yml @@ -2,7 +2,7 @@ shortcut_set_add_local_action: route_name: shortcut.set_add title: 'Add shortcut set' appears_on: - - shortcut.set_admin + - entity.shortcut_set.collection shortcut.link_add: route_name: shortcut.link_add title: 'Add shortcut' diff --git a/core/modules/shortcut/shortcut.links.menu.yml b/core/modules/shortcut/shortcut.links.menu.yml index 8c9ded5..5e4be81 100644 --- a/core/modules/shortcut/shortcut.links.menu.yml +++ b/core/modules/shortcut/shortcut.links.menu.yml @@ -1,5 +1,5 @@ -shortcut.set_admin: +entity.shortcut_set.collection: title: Shortcuts description: 'Add and modify shortcut sets.' - route_name: shortcut.set_admin + route_name: entity.shortcut_set.collection parent: system.admin_config_ui diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index ba9c43d..0399036 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -24,7 +24,7 @@ function shortcut_help($route_name, RouteMatchInterface $route_match) { $output .= '' . t('The Shortcut module allows users to create sets of shortcut links to commonly-visited pages of the site. Shortcuts are contained within sets. Each user with Select any shortcut set permission can select a shortcut set created by anyone at the site. For more information, see the online handbook entry for Shortcut module.', array('!shortcut' => 'http://drupal.org/documentation/modules/shortcut')) . '
'; $output .= '' . t('Taxonomy is for categorizing content. Terms are grouped into vocabularies. For example, a vocabulary called "Fruit" would contain the terms "Apple" and "Banana".') . '
'; return $output; diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 6fa970f..af86c9e 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -1,4 +1,4 @@ -taxonomy.vocabulary_list: +entity.taxonomy_vocabulary.collection: path: '/admin/structure/taxonomy' defaults: _entity_list: 'taxonomy_vocabulary' diff --git a/core/modules/user/src/Entity/Role.php b/core/modules/user/src/Entity/Role.php index 9bda8d0..b3dcdb5 100644 --- a/core/modules/user/src/Entity/Role.php +++ b/core/modules/user/src/Entity/Role.php @@ -38,7 +38,8 @@ * links = { * "delete-form" = "/admin/people/roles/manage/{user_role}/delete", * "edit-form" = "/admin/people/roles/manage/{user_role}", - * "edit-permissions-form" = "/admin/people/permissions/{user_role}" + * "edit-permissions-form" = "/admin/people/permissions/{user_role}", + * "collection" = "/admin/people/roles", * } * ) */ diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 7c8af82..abb72f8 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -54,6 +54,7 @@ * "canonical" = "/user/{user}", * "edit-form" = "/user/{user}/edit", * "cancel-form" = "/user/{user}/cancel", + * "collection" = "/admin/people", * }, * field_ui_base_route = "entity.user.admin_form", * ) diff --git a/core/modules/user/src/Form/UserCancelForm.php b/core/modules/user/src/Form/UserCancelForm.php index d3b6921..0297e70 100644 --- a/core/modules/user/src/Form/UserCancelForm.php +++ b/core/modules/user/src/Form/UserCancelForm.php @@ -125,7 +125,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { if ($this->currentUser()->hasPermission('administer users') && $form_state->isValueEmpty('user_cancel_confirm') && $this->entity->id() != $this->currentUser()->id()) { user_cancel($form_state->getValues(), $this->entity->id(), $form_state->getValue('user_cancel_method')); - $form_state->setRedirect('user.admin_account'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } else { // Store cancelling method and whether to notify the user in diff --git a/core/modules/user/src/Form/UserMultipleCancelConfirm.php b/core/modules/user/src/Form/UserMultipleCancelConfirm.php index 45f340f..da26ee7 100644 --- a/core/modules/user/src/Form/UserMultipleCancelConfirm.php +++ b/core/modules/user/src/Form/UserMultipleCancelConfirm.php @@ -87,7 +87,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('user.admin_account'); + return new Url('entity.user.collection'); } /** @@ -106,7 +106,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { ->get('user_user_operations_cancel') ->get($this->currentUser()->id()); if (!$accounts) { - return $this->redirect('user.admin_account'); + return $this->redirect('entity.user.collection'); } $form['accounts'] = array('#prefix' => '' . t("This web page allows administrators to register new users. Users' email addresses and usernames must be unique.") . '
'; case 'user.admin_permissions': - return '' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the Roles page to create a role.) Any permissions granted to the Authenticated user role will be given to any user who is logged in to your site. From the Account settings page, you can make any role into an Administrator role for the site, meaning that role will be granted all new permissions automatically. You should be careful to ensure that only trusted users are given this access and level of control of your site.', array('!role' => \Drupal::url('user.role_list'), '!settings' => \Drupal::url('entity.user.admin_form'))) . '
'; + return '' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the Roles page to create a role.) Any permissions granted to the Authenticated user role will be given to any user who is logged in to your site. From the Account settings page, you can make any role into an Administrator role for the site, meaning that role will be granted all new permissions automatically. You should be careful to ensure that only trusted users are given this access and level of control of your site.', array('!role' => \Drupal::url('entity.user_role.collection'), '!settings' => \Drupal::url('entity.user.admin_form'))) . '
'; - case 'user.role_list': + case 'entity.user_role.collection': return '' . t('A role defines a group of users that have certain privileges. These privileges are defined on the Permissions page. Here, you can define the names and the display sort order of the roles on your site. It is recommended to order roles from least permissive (for example, Anonymous user) to most permissive (for example, Administrator user). Users who are not logged in have the Anonymous user role. Users who are logged in have the Authenticated user role, plus any other roles granted to their user account.', array('!permissions' => \Drupal::url('user.admin_permissions'))) . '
'; case 'entity.user.field_ui_fields': diff --git a/core/modules/user/user.routing.yml b/core/modules/user/user.routing.yml index e96c76c..4f6a263 100644 --- a/core/modules/user/user.routing.yml +++ b/core/modules/user/user.routing.yml @@ -43,7 +43,7 @@ entity.user.admin_form: requirements: _permission: 'administer account settings' -user.admin_account: +entity.user.collection: path: '/admin/people' defaults: _entity_list: 'user' @@ -83,7 +83,7 @@ user.multiple_cancel_confirm: requirements: _permission: 'administer users' -user.role_list: +entity.user_role.collection: path: '/admin/people/roles' defaults: _entity_list: 'user_role' diff --git a/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php b/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php index 139f2f6..f933ea2 100644 --- a/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php +++ b/core/modules/views/src/Plugin/entity_reference/selection/ViewsSelection.php @@ -106,7 +106,7 @@ public static function settingsForm(FieldDefinitionInterface $field_definition) $form['view']['no_view_help'] = array( '#markup' => '' . t('No eligible views were found. Create a view with an Entity Reference display, or add such a display to an existing view.', array( '@create' => \Drupal::url('views_ui.add'), - '@existing' => \Drupal::url('views_ui.list'), + '@existing' => \Drupal::url('entity.view.collection'), )) . '
', ); } diff --git a/core/modules/views_ui/src/Controller/ViewsUIController.php b/core/modules/views_ui/src/Controller/ViewsUIController.php index 7649dd8..34168dd 100644 --- a/core/modules/views_ui/src/Controller/ViewsUIController.php +++ b/core/modules/views_ui/src/Controller/ViewsUIController.php @@ -162,7 +162,7 @@ public function ajaxOperation(ViewEntityInterface $view, $op, Request $request) } // Otherwise, redirect back to the page. - return $this->redirect('views_ui.list'); + return $this->redirect('entity.view.collection'); } /** diff --git a/core/modules/views_ui/src/ViewAddForm.php b/core/modules/views_ui/src/ViewAddForm.php index d4c9410..845bd67 100644 --- a/core/modules/views_ui/src/ViewAddForm.php +++ b/core/modules/views_ui/src/ViewAddForm.php @@ -188,7 +188,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // @todo Figure out whether it really makes sense to throw and catch exceptions on the wizard. catch (WizardException $e) { drupal_set_message($e->getMessage(), 'error'); - $form_state->setRedirect('views_ui.list'); + $form_state->setRedirect('entity.view.collection'); return; } $this->entity->save(); @@ -205,7 +205,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { * The current state of the form. */ public function cancel(array $form, FormStateInterface $form_state) { - $form_state->setRedirect('views_ui.list'); + $form_state->setRedirect('entity.view.collection'); } } diff --git a/core/modules/views_ui/src/ViewDeleteForm.php b/core/modules/views_ui/src/ViewDeleteForm.php index 918b2ef..3c593ea 100644 --- a/core/modules/views_ui/src/ViewDeleteForm.php +++ b/core/modules/views_ui/src/ViewDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a delete form for a view. @@ -27,7 +26,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('views_ui.list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index 055a12b..64b3c88 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -342,7 +342,7 @@ public function cancel(array $form, FormStateInterface $form_state) { // Remove this view from cache so edits will be lost. $view = $this->entity; $this->tempStore->delete($view->id()); - $form_state->setRedirect('views_ui.list'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } /** diff --git a/core/modules/views_ui/views_ui.info.yml b/core/modules/views_ui/views_ui.info.yml index 0230b6e..71770b8 100644 --- a/core/modules/views_ui/views_ui.info.yml +++ b/core/modules/views_ui/views_ui.info.yml @@ -4,6 +4,6 @@ description: 'Administrative interface for Views.' package: Core version: VERSION core: 8.x -configure: views_ui.list +configure: entity.view.collection dependencies: - views diff --git a/core/modules/views_ui/views_ui.links.action.yml b/core/modules/views_ui/views_ui.links.action.yml index 6a0ded0..6a3c936 100644 --- a/core/modules/views_ui/views_ui.links.action.yml +++ b/core/modules/views_ui/views_ui.links.action.yml @@ -2,4 +2,4 @@ views_add_local_action: route_name: views_ui.add title: 'Add new view' appears_on: - - views_ui.list + - entity.view.collection diff --git a/core/modules/views_ui/views_ui.links.menu.yml b/core/modules/views_ui/views_ui.links.menu.yml index e799469..3f38307 100644 --- a/core/modules/views_ui/views_ui.links.menu.yml +++ b/core/modules/views_ui/views_ui.links.menu.yml @@ -1,8 +1,8 @@ -views_ui.list: +entity.view.collection: title: Views parent: system.admin_structure description: 'Manage customized lists of content.' - route_name: views_ui.list + route_name: entity.view.collection views_ui.reports_plugins: title: 'Views plugins' parent: system.admin_reports diff --git a/core/modules/views_ui/views_ui.links.task.yml b/core/modules/views_ui/views_ui.links.task.yml index c7fe8b0..91b8c87 100644 --- a/core/modules/views_ui/views_ui.links.task.yml +++ b/core/modules/views_ui/views_ui.links.task.yml @@ -1,7 +1,7 @@ views_ui.settings_tab: route_name: views_ui.settings_basic title: Settings - base_route: views_ui.list + base_route: entity.view.collection views_ui.settings_basic_tab: route_name: views_ui.settings_basic @@ -15,14 +15,14 @@ views_ui.settings_advanced_tab: weight: 10 views_ui.list_tab: - route_name: views_ui.list + route_name: entity.view.collection title: List - base_route: views_ui.list + base_route: entity.view.collection views_ui.reports_fields: route_name: views_ui.reports_fields title: 'Used in views' - base_route: field_ui.list + base_route: entity.field_storage_config.collection entity.view.edit_form: title: 'Edit' diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index c0049fe..5ac6790 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -28,9 +28,9 @@ function views_ui_help($route_name, RouteMatchInterface $route_match) { $output .= '