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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Using simple actions') . '
'; - $output .= '
' . t('Simple actions do not require configuration and are listed automatically as available on the Actions page.', array('!actions' => \Drupal::url('action.admin'))) . '
'; + $output .= '
' . t('Simple actions do not require configuration and are listed automatically as available on the Actions page.', array('!actions' => \Drupal::url('entity.action.collection'))) . '
'; $output .= '
' . t('Creating and configuring advanced actions') . '
'; - $output .= '
' . t('Advanced actions are user-created and have to be configured individually. Create an advanced action on the Actions page by selecting an action type from the drop-down list. Then configure your action, for example by specifying the recipient of an automated email message.', array('!actions' => \Drupal::url('action.admin'))) . '
'; + $output .= '
' . t('Advanced actions are user-created and have to be configured individually. Create an advanced action on the Actions page by selecting an action type from the drop-down list. Then configure your action, for example by specifying the recipient of an automated email message.', array('!actions' => \Drupal::url('entity.action.collection'))) . '
'; $output .= '
'; return $output; - case 'action.admin': + case 'entity.action.collection': $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('About') . '

'; - $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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Creating and managing custom block types') . '
'; - $output .= '
' . t('Users with the Administer blocks permission can create different custom block types, each with different fields and display settings, from the Custom block types page. The Custom block types page lists all of your created custom block types, and allows you to edit and manage them. For more information about managing fields and display settings, see the Field UI module help.', array('!types' => \Drupal::url('block_content.type_list'), '!field-ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; + $output .= '
' . t('Users with the Administer blocks permission can create different custom block types, each with different fields and display settings, from the Custom block types page. The Custom block types page lists all of your created custom block types, and allows you to edit and manage them. For more information about managing fields and display settings, see the Field UI module help.', array('!types' => \Drupal::url('entity.block_content_type.collection'), '!field-ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; $output .= '
' . t('Creating custom blocks') . '
'; $output .= '
' . t('Users with the Administer blocks permission can add custom blocks of each of their defined custom block types. Created custom blocks are then listed on the Blocks administration page.', array('!blocks' => \Drupal::url('block.admin_display'), '!block-add' => \Drupal::url('block_content.add_page'))) . '
'; $output .= '
'; return $output; - case 'block_content.list': + case 'entity.block_content.collection': $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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Enabling commenting and configuring defaults') . '
'; - $output .= '
' . t('Comment functionality can be enabled for any entity sub-type (for example, a content type). On the Manage fields page for each entity sub-type, you can enable commenting by adding a Comments field. The entity sub-types each have their own default comment settings configured as: Open to allow new comments, Closed to view existing comments, but prevent new comments, or Hidden to hide existing comments and prevent new comments.', array('!content-type' => \Drupal::url('node.overview_types'), '!entity-help' => \Drupal::url('help.page', array('name' => 'entity')))) . '
'; + $output .= '
' . t('Comment functionality can be enabled for any entity sub-type (for example, a content type). On the Manage fields page for each entity sub-type, you can enable commenting by adding a Comments field. The entity sub-types each have their own default comment settings configured as: Open to allow new comments, Closed to view existing comments, but prevent new comments, or Hidden to hide existing comments and prevent new comments.', array('!content-type' => \Drupal::url('entity.node_type.collection'), '!entity-help' => \Drupal::url('help.page', array('name' => 'entity')))) . '
'; $output .= '
' . t('Overriding default settings') . '
'; $output .= '
' . t('When you create an entity item, you can override the default comment settings. Changing the entity sub-type defaults will not affect existing entity items, whether they used the default settings or had overrides.') . '
'; $output .= '
' . t('Approving and managing comments') . '
'; @@ -77,7 +77,7 @@ function comment_help($route_name, RouteMatchInterface $route_match) { $output .= '
'; return $output; - case 'comment.type_list': + case 'entity.comment_type.collection': $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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Enabling translation') . '
'; - $output .= '
' . t('In order to translate configuration, the website must have at least two languages.', array('!url' => \Drupal::url('language.admin_overview'))) . '
'; + $output .= '
' . t('In order to translate configuration, the website must have at least two languages.', array('!url' => \Drupal::url('entity.configurable_language.collection'))) . '
'; $output .= '
' . t('Translating configuration text') . '
'; $output .= '
' . t('Users with the Translate user edited configuration permission can access the configuration translation overview, and manage translations for specific languages. The Configuration translation page shows a list of all configuration text that can be translated, either as individual items or as lists. After you click on Translate, you are provided with a list of all languages. You can add or edit a translation for a specific language. Users with specific configuration permissions can also edit the text for the site\'s default language. For some configuration text items (for example for the site information), the specific translation pages can also be accessed directly from their configuration pages.', array('!translation-page' => \Drupal::url('config_translation.mapper_list'))) . '
'; $output .= '
' . t('Translating date formats') . '
'; diff --git a/core/modules/contact/contact.info.yml b/core/modules/contact/contact.info.yml index a50d17d..2507fbd 100644 --- a/core/modules/contact/contact.info.yml +++ b/core/modules/contact/contact.info.yml @@ -4,4 +4,4 @@ description: 'Enables the use of both personal and site-wide contact forms.' package: Core version: VERSION core: 8.x -configure: contact.form_list +configure: entity.contact_form.collection diff --git a/core/modules/contact/contact.links.action.yml b/core/modules/contact/contact.links.action.yml index 78e139a..a191f80 100644 --- a/core/modules/contact/contact.links.action.yml +++ b/core/modules/contact/contact.links.action.yml @@ -3,4 +3,4 @@ contact.form_add: title: 'Add contact form' weight: 1 appears_on: - - contact.form_list + - entity.contact_form.collection diff --git a/core/modules/contact/contact.links.menu.yml b/core/modules/contact/contact.links.menu.yml index 92c15d0..45db457 100644 --- a/core/modules/contact/contact.links.menu.yml +++ b/core/modules/contact/contact.links.menu.yml @@ -1,8 +1,8 @@ -contact.form_list: +entity.contact_form.collection: title: 'Contact forms' parent: system.admin_structure description: 'Create and manage contact forms.' - route_name: contact.form_list + route_name: entity.contact_form.collection contact.site_page: title: Contact route_name: contact.site_page diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index c56633f..3f22485 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -24,15 +24,15 @@ function contact_help($route_name, RouteMatchInterface $route_match) { $output .= '
' . t('Site-wide contact forms') . '
'; $output .= '
' . t('The Contact page provides a simple form for users with the Use the site-wide contact form permission to send comments, feedback, or other requests. You can create forms for directing the contact messages to a set of defined recipients. Common forms for a business site, for example, might include "Website feedback" (messages are forwarded to website administrators) and "Product information" (messages are forwarded to members of the sales department). Email addresses defined within a form are not displayed publicly.', array('@contact' => \Drupal::url('contact.site_page'))) . '

'; $output .= '
' . t('Navigation') . '
'; - $output .= '
' . t('When the site-wide contact form is enabled, a link in the Footer menu is created, which you can modify on the Menus administration page.', array('@menu' => \Drupal::url('menu_ui.overview_page'))) . '
'; + $output .= '
' . t('When the site-wide contact form is enabled, a link in the Footer menu is created, which you can modify on the Menus administration page.', array('@menu' => \Drupal::url('entity.menu.collection'))) . '
'; $output .= '
' . t('Customization') . '
'; $output .= '
' . t('If you would like additional text to appear on the site-wide or personal contact page, use a block. You can create and edit blocks on the Blocks administration page.', array('@blocks' => \Drupal::url('block.admin_display'))) . '
'; $output .= '
'; return $output; - case 'contact.form_list': + case 'entity.contact_form.collection': $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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Enabling translation') . '
'; - $output .= '
' . t('In order to translate content, the website must have at least two languages. When that is the case, you can enable translation for the desired content entities on the Content language page. When enabling translation you can choose the default language for content and decide whether to show the language selection field on the content editing forms.', array('!url' => \Drupal::url('language.admin_overview'), '!translation-entity' => \Drupal::url('language.content_settings_page'), '!language-help' => \Drupal::url('help.page', array('name' => 'language')))) . '
'; + $output .= '
' . t('In order to translate content, the website must have at least two languages. When that is the case, you can enable translation for the desired content entities on the Content language page. When enabling translation you can choose the default language for content and decide whether to show the language selection field on the content editing forms.', array('!url' => \Drupal::url('entity.configurable_language.collection'), '!translation-entity' => \Drupal::url('language.content_settings_page'), '!language-help' => \Drupal::url('help.page', array('name' => 'language')))) . '
'; $output .= '
' . t('Enabling field translation') . '
'; $output .= '
' . t('You can define which fields of a content entity can be translated. For example, you might want to translate the title and body field while leaving the image field untranslated. If you exclude a field from being translated, it will still show up in the content editing form, but any changes made to that field will be applied to all translations of that content.') . '
'; $output .= '
' . t('Translating content') . '
'; @@ -40,7 +40,7 @@ function content_translation_help($route_name, RouteMatchInterface $route_match) case 'language.content_settings_page': $output = ''; if (!\Drupal::languageManager()->isMultilingual()) { - $output .= '
' . t('Before you can translate content, there must be at least two languages added on the languages administration page.', array('!url' => \Drupal::url('language.admin_overview'))); + $output .= '
' . t('Before you can translate content, there must be at least two languages added on the languages administration page.', array('!url' => \Drupal::url('entity.configurable_language.collection'))); } return $output; } diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module index 42c8853..113d9e7 100644 --- a/core/modules/datetime/datetime.module +++ b/core/modules/datetime/datetime.module @@ -39,7 +39,7 @@ function datetime_help($route_name, RouteMatchInterface $route_match) { $output .= '
' . t('Managing and displaying date fields') . '
'; $output .= '
' . t('The settings and the display of the Date field can be configured separately. See the Field UI help for more information on how to manage fields and their display.', array('!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; $output .= '
' . t('Displaying dates') . '
'; - $output .= '
' . t('Dates can be displayed using the Plain or the Default formatter. The Plain formatter displays the date in the ISO 8601 format. If you choose the Default formatter, you can choose a format from a predefined list that can be managed on the Date and time formats page.', array('!date_format_list'=> \Drupal::url('system.date_format_list'))) . '
'; + $output .= '
' . t('Dates can be displayed using the Plain or the Default formatter. The Plain formatter displays the date in the ISO 8601 format. If you choose the Default formatter, you can choose a format from a predefined list that can be managed on the Date and time formats page.', array('!date_format_list'=> \Drupal::url('entity.date_format.collection'))) . '
'; $output .= '
'; return $output; } diff --git a/core/modules/field_ui/field_ui.links.action.yml b/core/modules/field_ui/field_ui.links.action.yml index b03bac5..4523843 100644 --- a/core/modules/field_ui/field_ui.links.action.yml +++ b/core/modules/field_ui/field_ui.links.action.yml @@ -3,14 +3,14 @@ field_ui.entity_view_mode_add: title: 'Add new view mode' weight: 1 appears_on: - - field_ui.entity_view_mode_list + - entity.entity_view_mode.collection field_ui.entity_form_mode_add: route_name: field_ui.entity_form_mode_add title: 'Add new form mode' weight: 1 appears_on: - - field_ui.entity_form_mode_list + - entity.entity_form_mode.collection field_ui.field_storage_config_add: class: \Drupal\Core\Menu\LocalActionDefault diff --git a/core/modules/field_ui/field_ui.links.menu.yml b/core/modules/field_ui/field_ui.links.menu.yml index 1d3fdb0..f3ed518 100644 --- a/core/modules/field_ui/field_ui.links.menu.yml +++ b/core/modules/field_ui/field_ui.links.menu.yml @@ -1,7 +1,7 @@ -field_ui.list: +entity.field_storage_config.collection: title: 'Field list' description: 'Overview of fields on all entity types.' - route_name: field_ui.list + route_name: entity.field_storage_config.collection parent: system.admin_reports field_ui.display_mode: @@ -10,14 +10,14 @@ field_ui.display_mode: route_name: field_ui.display_mode parent: system.admin_structure -field_ui.entity_view_mode_list: +entity.entity_view_mode.collection: title: 'View modes' description: 'Manage custom view modes.' - route_name: field_ui.entity_view_mode_list + route_name: entity.entity_view_mode.collection parent: field_ui.display_mode -field_ui.entity_form_mode_list: +entity.entity_form_mode.collection: title: 'Form modes' description: 'Manage custom form modes.' - route_name: field_ui.entity_form_mode_list + route_name: entity.entity_form_mode.collection parent: field_ui.display_mode diff --git a/core/modules/field_ui/field_ui.links.task.yml b/core/modules/field_ui/field_ui.links.task.yml index 7bb8f54..5ee3eff 100644 --- a/core/modules/field_ui/field_ui.links.task.yml +++ b/core/modules/field_ui/field_ui.links.task.yml @@ -1,7 +1,7 @@ -field_ui.list: +entity.field_storage_config.collection: title: Entities - route_name: field_ui.list - base_route: field_ui.list + route_name: entity.field_storage_config.collection + base_route: entity.field_storage_config.collection field_ui.fields: class: \Drupal\Core\Menu\LocalTaskDefault @@ -17,12 +17,12 @@ field_ui.entity_form_mode.edit_form: route_name: field_ui.entity_form_mode.edit_form base_route: field_ui.entity_form_mode.edit_form -field_ui.entity_view_mode_list: +entity.entity_view_mode.collection: title: List - route_name: field_ui.entity_view_mode_list - base_route: field_ui.entity_view_mode_list + route_name: entity.entity_view_mode.collection + base_route: entity.entity_view_mode.collection -field_ui.entity_form_mode_list: +entity.entity_form_mode.collection: title: List - route_name: field_ui.entity_form_mode_list - base_route: field_ui.entity_form_mode_list + route_name: entity.entity_form_mode.collection + base_route: entity.entity_form_mode.collection diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index c314a6c..96b9848 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -44,26 +44,26 @@ function field_ui_help($route_name, RouteMatchInterface $route_match) { $output .= '
' . t('There are two main reasons for reusing fields. First, reusing fields can save you time over defining new fields. Second, reusing fields also allows you to display, filter, group, and sort content together by field across content types. For example, the contributed Views module allows you to create lists and tables of content. So if you use the same field on multiple content types, you can create a View containing all of those content types together displaying that field, sorted by that field, and/or filtered by that field.') . '
'; if ($module_handler->moduleExists('node')) { $output .= '
' . t('Fields on content items') . '
'; - $output .= '
' . t('Fields on content items are defined at the content-type level, on the Manage fields tab of the content type edit page (which you can reach from the Content types page). When you define a field for a content type, each content item of that type will have that field added to it. Some fields, such as the Title and Body, are provided for you when you create a content type, or are provided on content types created by your installation profile.', array('@types' => \Drupal::url('node.overview_types'))) . '
'; + $output .= '
' . t('Fields on content items are defined at the content-type level, on the Manage fields tab of the content type edit page (which you can reach from the Content types page). When you define a field for a content type, each content item of that type will have that field added to it. Some fields, such as the Title and Body, are provided for you when you create a content type, or are provided on content types created by your installation profile.', array('@types' => \Drupal::url('entity.node_type.collection'))) . '
'; } if ($module_handler->moduleExists('taxonomy')) { $output .= '
' . t('Fields on taxonomy terms') . '
'; - $output .= '
' . t('Fields on taxonomy terms are defined at the taxonomy vocabulary level, on the Manage fields tab of the vocabulary edit page (which you can reach from the Taxonomy page). When you define a field for a vocabulary, each term in that vocabulary will have that field added to it. For example, you could define an image field for a vocabulary to store an icon with each term.', array('@taxonomy' => \Drupal::url('taxonomy.vocabulary_list'))) . '
'; + $output .= '
' . t('Fields on taxonomy terms are defined at the taxonomy vocabulary level, on the Manage fields tab of the vocabulary edit page (which you can reach from the Taxonomy page). When you define a field for a vocabulary, each term in that vocabulary will have that field added to it. For example, you could define an image field for a vocabulary to store an icon with each term.', array('@taxonomy' => \Drupal::url('entity.taxonomy_vocabulary.collection'))) . '
'; } $output .= '
' . t('Fields on user accounts') . '
'; $output .= '
' . t('Fields on user accounts are defined on a site-wide basis on the Manage fields tab of the Account settings page. When you define a field for user accounts, each user account will have that field added to it. For example, you could add a long text field to allow users to include a biography.', array('@fields' => \Drupal::url('entity.user.field_ui_fields'), '@accounts' => \Drupal::url('entity.user.admin_form'))) . '
'; if ($module_handler->moduleExists('comment')) { $output .= '
' . t('Fields on comments') . '
'; - $output .= '
' . t('Fields on comments are defined at the comment entity level, on the Manage fields tab of the comment types edit page (which you can reach from the Comment types page). When you add a field for comments, each comment on an entity with that comment type will have that field added to it. For example, you could add a website field to the comments on forum posts, to allow forum commenters to add a link to their website.', array('@types' => \Drupal::url('comment.type_list'))) . '
'; + $output .= '
' . t('Fields on comments are defined at the comment entity level, on the Manage fields tab of the comment types edit page (which you can reach from the Comment types page). When you add a field for comments, each comment on an entity with that comment type will have that field added to it. For example, you could add a website field to the comments on forum posts, to allow forum commenters to add a link to their website.', array('@types' => \Drupal::url('entity.comment_type.collection'))) . '
'; } $output .= '
' . t('Managing view modes') . '
'; - $output .= '
' . t('Each content entity can have various "modes" for viewing. For instance, a content item could be viewed in full content mode on its own page, teaser mode in a list, or RSS mode in a feed. You can create, edit the names of, and delete view modes on the View modes page. Once a view mode has been set up, you can choose and format fields for the view mode within each entity sub-type on the Manage display page. See the Field UI module help page for more information.', array('!view-modes' => \Drupal::url('field_ui.entity_view_mode_list'), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; + $output .= '
' . t('Each content entity can have various "modes" for viewing. For instance, a content item could be viewed in full content mode on its own page, teaser mode in a list, or RSS mode in a feed. You can create, edit the names of, and delete view modes on the View modes page. Once a view mode has been set up, you can choose and format fields for the view mode within each entity sub-type on the Manage display page. See the Field UI module help page for more information.', array('!view-modes' => \Drupal::url('entity.entity_view_mode.collection'), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; $output .= '
' . t('Managing form modes') . '
'; - $output .= '
' . t('Each content entity can have various editing forms appropriate for different situations, which are known as "form modes". For instance, you might want to define a quick editing mode that allows users to edit the most important fields, and a full editing mode that gives access to all the fields. You can create, edit the names of, and delete form modes on the Manage custom form modes page. Once a form mode has been set up, you can choose which fields are available on that form within each entity sub-type on the Manage form display page. See the Field UI module help page for more information.', array('!form-modes' => \Drupal::url('field_ui.entity_form_mode_list'), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; + $output .= '
' . t('Each content entity can have various editing forms appropriate for different situations, which are known as "form modes". For instance, you might want to define a quick editing mode that allows users to edit the most important fields, and a full editing mode that gives access to all the fields. You can create, edit the names of, and delete form modes on the Manage custom form modes page. Once a form mode has been set up, you can choose which fields are available on that form within each entity sub-type on the Manage form display page. See the Field UI module help page for more information.', array('!form-modes' => \Drupal::url('entity.entity_form_mode.collection'), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')))) . '
'; $output .= ''; return $output; - case 'field_ui.list': + case 'entity.field_storage_config.collection': return '

' . 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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Manipulating images') . '
'; - $output .= '
' . t('With the Image module you can scale, crop, resize, rotate and desaturate images without affecting the original image using image styles. When you change an image style, the module automatically refreshes all created images. Every image style must have a name, which will be used in the URL of the generated images. There are two common approaches to naming image styles (which you use will depend on how the image style is being applied):',array('@image' => \Drupal::url('image.style_list'))); + $output .= '
' . t('With the Image module you can scale, crop, resize, rotate and desaturate images without affecting the original image using image styles. When you change an image style, the module automatically refreshes all created images. Every image style must have a name, which will be used in the URL of the generated images. There are two common approaches to naming image styles (which you use will depend on how the image style is being applied):',array('@image' => \Drupal::url('entity.image_style.collection'))); $output .= ''; $output .= t('After you create an image style, you can add effects: crop, scale, resize, rotate, and desaturate (other contributed modules provide additional effects). For example, by combining effects as crop, scale, and desaturate, you can create square, grayscale thumbnails.') . '
'; $output .= '
' . t('Attaching images to content as fields') . '
'; - $output .= '
' . t("Image module also allows you to attach images to content as fields. To add an image field to a content type, go to the content type's manage fields page, and add a new field of type Image. Attaching images to content this way allows image styles to be applied and maintained, and also allows you more flexibility when theming.", array('@content-type' => \Drupal::url('node.overview_types'))) . '
'; + $output .= '
' . t("Image module also allows you to attach images to content as fields. To add an image field to a content type, go to the content type's manage fields page, and add a new field of type Image. Attaching images to content this way allows image styles to be applied and maintained, and also allows you more flexibility when theming.", array('@content-type' => \Drupal::url('entity.node_type.collection'))) . '
'; $output .= '
' . t('Configuring image fields for accessibility') . '
'; $output .= '
' . t('For accessibility and search engine optimization, all images that convey meaning on web sites should have alternate text. Drupal also allows entry of title text for images, but it can lead to confusion for screen reader users and its use is not recommended. Image fields can be configured so that alternate and title text fields are enabled or disabled; if enabled, the fields can be set to be required. The recommended setting is to enable and require alternate text and disable title text.') . '
'; $output .= '
'; return $output; - case 'image.style_list': + case 'entity.image_style.collection': return '

' . 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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Adding languages') . '
'; - $output .= '
' . t('You can add languages on the Languages page by selecting Add language and choosing a language from the drop-down menu. This language is then displayed in the languages list, where it can be configured further. If the Interface translation module is enabled, and the translation server is set as a translation source, then the interface translation for this language is automatically downloaded as well.' , array('!language_list' => \Drupal::url('language.admin_overview'), '!interface' => (\Drupal::moduleHandler()->moduleExists('locale')) ? \Drupal::url('help.page', array('name' => 'locale')) : '#')) . '
'; + $output .= '
' . t('You can add languages on the Languages page by selecting Add language and choosing a language from the drop-down menu. This language is then displayed in the languages list, where it can be configured further. If the Interface translation module is enabled, and the translation server is set as a translation source, then the interface translation for this language is automatically downloaded as well.' , array('!language_list' => \Drupal::url('entity.configurable_language.collection'), '!interface' => (\Drupal::moduleHandler()->moduleExists('locale')) ? \Drupal::url('help.page', array('name' => 'locale')) : '#')) . '
'; $output .= '
' . t('Adding custom languages') . '
'; $output .= '
' . t('You can add a language that is not provided in the drop-down list by choosing Custom language at the end of the list. You then have to configure its language code, name, and direction in the form provided.') . '
'; $output .= '
' . t('Configuring content languages') . '
'; @@ -48,13 +48,13 @@ function language_help($route_name, RouteMatchInterface $route_match) { $output .= ''; $output .= '
'; return $output; - case 'language.admin_overview': + case 'entity.configurable_language.collection': return '

' . 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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Importing translation files') . '
'; - $output .= '
' . t('Translation files with translated interface text are imported automatically when languages are added on the Languages page, or when modules or themes are enabled. On the Settings page, the Translation source can be restricted to local files only, or to include the Drupal translation server. Although modules and themes may not be fully translated in all languages, new translations become available frequently. You can specify whether and how often to check for translation file updates and whether to overwrite existing translations on the Settings page. You can also manually import a translation file on the Import page.', array('!import' => \Drupal::url('locale.translate_import'), '!locale-settings' => \Drupal::url('locale.settings'), '!languages' => \Drupal::url('language.admin_overview'), '!server' => 'https://localize.drupal.org')) . '
'; + $output .= '
' . t('Translation files with translated interface text are imported automatically when languages are added on the Languages page, or when modules or themes are enabled. On the Settings page, the Translation source can be restricted to local files only, or to include the Drupal translation server. Although modules and themes may not be fully translated in all languages, new translations become available frequently. You can specify whether and how often to check for translation file updates and whether to overwrite existing translations on the Settings page. You can also manually import a translation file on the Import page.', array('!import' => \Drupal::url('locale.translate_import'), '!locale-settings' => \Drupal::url('locale.settings'), '!languages' => \Drupal::url('entity.configurable_language.collection'), '!server' => 'https://localize.drupal.org')) . '
'; $output .= '
' . t('Checking the translation status') . '
'; - $output .= '
' . t('You can check how much of the interface on your site is translated into which language on the Languages page. On the Available translation updates page, you can check whether interface translation updates are available on the Drupal translation server.', array('!languages' => \Drupal::url('language.admin_overview'), '!translation-updates' => \Drupal::url('locale.translate_status'), '!server' => 'https://localize.drupal.org')) . '
'; + $output .= '
' . t('You can check how much of the interface on your site is translated into which language on the Languages page. On the Available translation updates page, you can check whether interface translation updates are available on the Drupal translation server.', array('!languages' => \Drupal::url('entity.configurable_language.collection'), '!translation-updates' => \Drupal::url('locale.translate_status'), '!server' => 'https://localize.drupal.org')) . '
'; $output .= '
' . t('Translating individual strings') . '
'; $output .= '
' . t('You can translate individual strings directly on the User interface translation page, or download the currently-used translation file for a specific language on the Export page. Once you have edited the translation file, you can then import it again on the Import page.', array('!translate' => \Drupal::url('locale.translate_page'), '!export' => \Drupal::url('locale.translate_export'), '!import' => \Drupal::url('locale.translate_import'))) . '
'; $output .= '
'; return $output; - case 'language.admin_overview': + case 'entity.configurable_language.collection': return '

' . 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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Managing menus') . '
'; - $output .= '
' . t('Users with the Administer menus and menu items permission can add, edit, and delete custom menus on the Menus page. Custom menus can be special site menus, menus of external links, or any combination of internal and external links. You may create an unlimited number of additional menus, each of which will automatically have an associated block (if you have the Block module installed). By selecting Edit menu, you can add, edit, or delete links for a given menu. The links listing page provides a drag-and-drop interface for controlling the order of links, and creating a hierarchy within the menu.', array('!block_help' => \Drupal::url('help.page', array('name' => 'block')), '!menu' => \Drupal::url('menu_ui.overview_page'))) . '
'; + $output .= '
' . t('Users with the Administer menus and menu items permission can add, edit, and delete custom menus on the Menus page. Custom menus can be special site menus, menus of external links, or any combination of internal and external links. You may create an unlimited number of additional menus, each of which will automatically have an associated block (if you have the Block module installed). By selecting Edit menu, you can add, edit, or delete links for a given menu. The links listing page provides a drag-and-drop interface for controlling the order of links, and creating a hierarchy within the menu.', array('!block_help' => \Drupal::url('help.page', array('name' => 'block')), '!menu' => \Drupal::url('entity.menu.collection'))) . '
'; $output .= '
' . t('Displaying menus') . '
'; $output .= '
' . t('If you have the Block module enabled, then each menu that you create is rendered in a block that you enable and position on the Block layout page. In some themes, the main menu and possibly the secondary menu will be output automatically; you may be able to disable this behavior on the theme\'s settings page.', array('!blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#', '!themes' => \Drupal::url('system.themes_page'), '!theme_settings' => \Drupal::url('system.theme_settings'))) . '
'; $output .= '
'; @@ -48,7 +48,7 @@ function menu_ui_help($route_name, RouteMatchInterface $route_match) { if ($route_name == 'entity.menu.add_form' && \Drupal::moduleHandler()->moduleExists('block')) { return '

' . 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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Creating content') . '
'; - $output .= '
' . t('When new content is created, the Node module records basic information about the content, including the author, date of creation, and the Content type. It also manages the publishing options, which define whether or not the content is published, promoted to the front page of the site, and/or sticky at the top of content lists. Default settings can be configured for each type of content on your site.', array('!content-type' => \Drupal::url('node.overview_types'))) . '
'; + $output .= '
' . t('When new content is created, the Node module records basic information about the content, including the author, date of creation, and the Content type. It also manages the publishing options, which define whether or not the content is published, promoted to the front page of the site, and/or sticky at the top of content lists. Default settings can be configured for each type of content on your site.', array('!content-type' => \Drupal::url('entity.node_type.collection'))) . '
'; $output .= '
' . t('Creating custom content types') . '
'; $output .= '
' . t('The Node module gives users with the Administer content types permission the ability to create new content types in addition to the default ones already configured. Creating custom content types allows you the flexibility to add fields and configure default settings that suit the differing needs of various site content.', array('!content-new' => \Drupal::url('node.type_add'), '!field' => \Drupal::url('help.page', array('name' => 'field')))) . '
'; $output .= '
' . t('Administering content') . '
'; diff --git a/core/modules/node/node.routing.yml b/core/modules/node/node.routing.yml index 2eff2f0..0b90a33 100644 --- a/core/modules/node/node.routing.yml +++ b/core/modules/node/node.routing.yml @@ -80,7 +80,7 @@ node.revision_delete_confirm: options: _node_operation_route: TRUE -node.overview_types: +entity.node_type.collection: path: '/admin/structure/types' defaults: _controller: '\Drupal\Core\Entity\Controller\EntityListController::listing' diff --git a/core/modules/node/src/Entity/NodeType.php b/core/modules/node/src/Entity/NodeType.php index 8f55f79..8a08d26 100644 --- a/core/modules/node/src/Entity/NodeType.php +++ b/core/modules/node/src/Entity/NodeType.php @@ -36,7 +36,8 @@ * }, * links = { * "edit-form" = "/admin/structure/types/manage/{node_type}", - * "delete-form" = "/admin/structure/types/manage/{node_type}/delete" + * "delete-form" = "/admin/structure/types/manage/{node_type}/delete", + * "collection" = "/admin/structure/types", * } * ) */ diff --git a/core/modules/node/src/Form/NodeTypeDeleteConfirm.php b/core/modules/node/src/Form/NodeTypeDeleteConfirm.php index 2d662c1..31c4461 100644 --- a/core/modules/node/src/Form/NodeTypeDeleteConfirm.php +++ b/core/modules/node/src/Form/NodeTypeDeleteConfirm.php @@ -10,7 +10,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -55,7 +54,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('node.overview_types'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/node/src/NodeTypeForm.php b/core/modules/node/src/NodeTypeForm.php index cbfe841..2292cf0 100644 --- a/core/modules/node/src/NodeTypeForm.php +++ b/core/modules/node/src/NodeTypeForm.php @@ -233,7 +233,7 @@ public function save(array $form, FormStateInterface $form_state) { elseif ($status == SAVED_NEW) { node_add_body_field($type); drupal_set_message(t('The content type %name has been added.', $t_args)); - $context = array_merge($t_args, array('link' => $this->l(t('View'), new Url('node.overview_types')))); + $context = array_merge($t_args, array('link' => $type->link($this->t('View'), 'collection'))); $this->logger('node')->notice('Added content type %name.', $context); } @@ -256,7 +256,7 @@ public function save(array $form, FormStateInterface $form_state) { } $this->entityManager->clearCachedFieldDefinitions(); - $form_state->setRedirect('node.overview_types'); + $form_state->setRedirectUrl($type->urlInfo('collection')); } } diff --git a/core/modules/responsive_image/responsive_image.info.yml b/core/modules/responsive_image/responsive_image.info.yml index 1991dc3..dec6fee 100644 --- a/core/modules/responsive_image/responsive_image.info.yml +++ b/core/modules/responsive_image/responsive_image.info.yml @@ -7,4 +7,4 @@ core: 8.x dependencies: - breakpoint - image -configure: responsive_image.mapping_page +configure: entity.responsive_image_mapping.collection diff --git a/core/modules/responsive_image/responsive_image.links.action.yml b/core/modules/responsive_image/responsive_image.links.action.yml index 302437e..6308cd1 100644 --- a/core/modules/responsive_image/responsive_image.links.action.yml +++ b/core/modules/responsive_image/responsive_image.links.action.yml @@ -2,4 +2,4 @@ responsive_image.mapping_page_add: route_name: responsive_image.mapping_page_add title: 'Add responsive image mapping' appears_on: - - responsive_image.mapping_page + - entity.responsive_image_mapping.collection diff --git a/core/modules/responsive_image/responsive_image.links.menu.yml b/core/modules/responsive_image/responsive_image.links.menu.yml index 796e1f5..c72d4ee 100644 --- a/core/modules/responsive_image/responsive_image.links.menu.yml +++ b/core/modules/responsive_image/responsive_image.links.menu.yml @@ -1,6 +1,6 @@ -responsive_image.mapping_page: +entity.responsive_image_mapping.collection: title: 'Responsive image mappings' description: 'Manage responsive image mappings' weight: 10 - route_name: responsive_image.mapping_page + route_name: entity.responsive_image_mapping.collection parent: system.admin_config_media diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index 600ce73..8c754bf 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -29,13 +29,13 @@ function responsive_image_help($route_name, RouteMatchInterface $route_match) { $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Defining responsive image mappings') . '
'; - $output .= '
' . t('By creating responsive image mappings you define the image styles that are being used to output images at certain breakpoints. On the Responsive image mappings page, click Add responsive image mapping to create a new mapping. First chose a label and a breakpoint group and click Save. After that you can choose the image styles that will be used for each breakpoint. Image styles can be defined on the Image styles page that is provided by the Image module. Breakpoints are defined in the configuration files of the theme. See the help page of the Breakpoint module for more information.', array('!responsive_image_mapping' => \Drupal::url('responsive_image.mapping_page'), '!image_styles' => \Drupal::url('image.style_list'),'!image_help' => \Drupal::url('help.page', array('name' => 'image')), '!breakpoint_help' => \Drupal::url('help.page', array('name' => 'breakpoint')))) . '
'; + $output .= '
' . t('By creating responsive image mappings you define the image styles that are being used to output images at certain breakpoints. On the Responsive image mappings page, click Add responsive image mapping to create a new mapping. First chose a label and a breakpoint group and click Save. After that you can choose the image styles that will be used for each breakpoint. Image styles can be defined on the Image styles page that is provided by the Image module. Breakpoints are defined in the configuration files of the theme. See the help page of the Breakpoint module for more information.', array('!responsive_image_mapping' => \Drupal::url('entity.responsive_image_mapping.collection'), '!image_styles' => \Drupal::url('entity.image_style.collection'),'!image_help' => \Drupal::url('help.page', array('name' => 'image')), '!breakpoint_help' => \Drupal::url('help.page', array('name' => 'breakpoint')))) . '
'; $output .= '
' . t('Using responsive image mappings in Image fields') . '
'; $output .= '
' . t('After defining responsive image mappings, you can use them in the display settings for your Image fields, so that the site displays responsive images using the HTML5 picture tag. Open the Manage display page for the entity type (content type, taxonomy vocabulary, etc.) that the Image field is attached to. Choose the format Responsive image, click the Edit icon, and select one of the responsive image mappings that you have created. For general information on how to manage fields and their display see the help page of the Field UI module. For information about entities see the help page of the Entity module.', array('!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')),'!entity_help' => \Drupal::url('help.page', array('name' => 'entity')))) . '
'; $output .= '
'; break; - case 'responsive_image.mapping_page': + case 'entity.responsive_image_mapping.collection': $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('Uses') . '

'; $output .= '
'; $output .= '
' . t('Configuring search pages') . '
'; - $output .= '
' . t('To configure search pages, visit the Search pages page. In the Search pages section, you can add a new search page, edit the configuration of existing search pages, enable and disable search pages, and choose the default search page. Each enabled search page has a URL path starting with search, and each will appear as a tab or local task link on the search page; you can configure the text that is shown in the tab. In addition, some search page plugins have additional settings that you can configure for each search page.', array('!search-settings' => \Drupal::url('search.settings'), '!search-url' => \Drupal::url('search.view'))) . '
'; + $output .= '
' . t('To configure search pages, visit the Search pages page. In the Search pages section, you can add a new search page, edit the configuration of existing search pages, enable and disable search pages, and choose the default search page. Each enabled search page has a URL path starting with search, and each will appear as a tab or local task link on the search page; you can configure the text that is shown in the tab. In addition, some search page plugins have additional settings that you can configure for each search page.', array('!search-settings' => \Drupal::url('entity.search_page.collection'), '!search-url' => \Drupal::url('search.view'))) . '
'; $output .= '
' . t('Managing the search index') . '
'; - $output .= '
' . t('Some search page plugins, such as the core Content search page, index searchable text using the Drupal core search index, and will not work unless content is indexed. Indexing is done during cron runs, so it requires a cron maintenance task to be set up. There are also several settings affecting indexing that can be configured on the Search pages page: the number of items to index per cron run, the minimum word length to index, and how to handle Chinese, Japanese, and Korean characters.', array('!cron' => \Drupal::url('system.cron_settings'), '!search-settings' => \Drupal::url('search.settings'))) . '
'; - $output .= '
' . t('Modules providing search page plugins generally ensure that content-related actions on your site (creating, editing, or deleting content and comments) automatically cause affected content items to be marked for indexing or reindexing at the next cron run. When content is marked for reindexing, the previous content remains in the index until cron runs, at which time it is replaced by the new content. However, there are some actions related to the structure of your site that do not cause affected content to be marked for reindexing. Examples of structure-related actions that affect content include deleting or editing taxonomy terms, enabling or disabling modules that add text to content (such as Taxonomy, Comment, and field-providing modules), and modifying the fields or display parameters of your content types. If you take one of these actions and you want to ensure that the search index is updated to reflect your changed site structure, you can mark all content for reindexing by clicking the "Re-index site" button on the Search pages page. If you have a lot of content on your site, it may take several cron runs for the content to be reindexed.', array('!search-settings' => \Drupal::url('search.settings'))) . '
'; + $output .= '
' . t('Some search page plugins, such as the core Content search page, index searchable text using the Drupal core search index, and will not work unless content is indexed. Indexing is done during cron runs, so it requires a cron maintenance task to be set up. There are also several settings affecting indexing that can be configured on the Search pages page: the number of items to index per cron run, the minimum word length to index, and how to handle Chinese, Japanese, and Korean characters.', array('!cron' => \Drupal::url('system.cron_settings'), '!search-settings' => \Drupal::url('entity.search_page.collection'))) . '
'; + $output .= '
' . t('Modules providing search page plugins generally ensure that content-related actions on your site (creating, editing, or deleting content and comments) automatically cause affected content items to be marked for indexing or reindexing at the next cron run. When content is marked for reindexing, the previous content remains in the index until cron runs, at which time it is replaced by the new content. However, there are some actions related to the structure of your site that do not cause affected content to be marked for reindexing. Examples of structure-related actions that affect content include deleting or editing taxonomy terms, enabling or disabling modules that add text to content (such as Taxonomy, Comment, and field-providing modules), and modifying the fields or display parameters of your content types. If you take one of these actions and you want to ensure that the search index is updated to reflect your changed site structure, you can mark all content for reindexing by clicking the "Re-index site" button on the Search pages page. If you have a lot of content on your site, it may take several cron runs for the content to be reindexed.', array('!search-settings' => \Drupal::url('entity.search_page.collection'))) . '
'; $output .= '
' . t('Displaying the Search block') . '
'; $output .= '
' . t('The Search module includes a block, which can be enabled and configured on the Block layout page, if you have the Block module enabled; the default block title is Search, and it is the Search form block in the Forms category, if you wish to add another instance. The block is available to users with the Use search permission, and it performs a search using the configured default search page.', array('!blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#', '!search_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-search')))) . '
'; $output .= '
' . t('Searching your site') . '
'; @@ -91,7 +91,7 @@ function search_help($route_name, RouteMatchInterface $route_match) { $output .= '
'; return $output; - case 'search.settings': + case 'entity.search_page.collection': return '

' . 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('Uses') . '

'; $output .= '
' . t('Administering shortcuts') . '
'; - $output .= '
' . t('Users with the Administer shortcuts permission can manage shortcut sets and edit the shortcuts within sets from the Shortcuts administration page.', array('!shortcuts' => \Drupal::url('shortcut.set_admin'))) . '
'; + $output .= '
' . t('Users with the Administer shortcuts permission can manage shortcut sets and edit the shortcuts within sets from the Shortcuts administration page.', array('!shortcuts' => \Drupal::url('entity.shortcut_set.collection'))) . '
'; $output .= '
' . t('Choosing shortcut sets') . '
'; $output .= '
' . t('Users with permission to switch shortcut sets can choose a shortcut set to use from the Shortcuts tab of their user account page.') . '
'; $output .= '
' . t('Adding and removing shortcuts') . '
'; @@ -34,7 +34,7 @@ function shortcut_help($route_name, RouteMatchInterface $route_match) { $output .= '
'; return $output; - case 'shortcut.set_admin': + case 'entity.shortcut_set.collection': case 'shortcut.set_add': case 'entity.shortcut_set.edit_form': $user = \Drupal::currentUser(); @@ -373,7 +373,7 @@ function shortcut_toolbar() { 'tab' => array( '#type' => 'link', '#title' => t('Shortcuts'), - '#url' => Url::fromRoute('shortcut.set_admin'), + '#url' => $shortcut_set->urlInfo('collection'), '#attributes' => array( 'title' => t('Shortcuts'), 'class' => array('toolbar-icon', 'toolbar-icon-shortcut'), diff --git a/core/modules/shortcut/shortcut.routing.yml b/core/modules/shortcut/shortcut.routing.yml index 7fb1c09..d6c0e1a 100644 --- a/core/modules/shortcut/shortcut.routing.yml +++ b/core/modules/shortcut/shortcut.routing.yml @@ -6,7 +6,7 @@ entity.shortcut_set.delete_form: requirements: _entity_access: 'shortcut_set.delete' -shortcut.set_admin: +entity.shortcut_set.collection: path: '/admin/config/user-interface/shortcut' defaults: _entity_list: 'shortcut_set' diff --git a/core/modules/shortcut/src/Entity/ShortcutSet.php b/core/modules/shortcut/src/Entity/ShortcutSet.php index 2b862c5..aa0ccfc 100644 --- a/core/modules/shortcut/src/Entity/ShortcutSet.php +++ b/core/modules/shortcut/src/Entity/ShortcutSet.php @@ -38,7 +38,8 @@ * links = { * "customize-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}/customize", * "delete-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}/delete", - * "edit-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}" + * "edit-form" = "/admin/config/user-interface/shortcut/manage/{shortcut_set}", + * "collection" = "/admin/config/user-interface/shortcut", * } * ) */ diff --git a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php index 0360053..c38d191 100644 --- a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php +++ b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php @@ -103,7 +103,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); - $form_state->setRedirect('shortcut.set_admin'); + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); drupal_set_message(t('The shortcut set %title has been deleted.', array('%title' => $this->entity->label()))); } diff --git a/core/modules/system/src/Form/DateFormatDeleteForm.php b/core/modules/system/src/Form/DateFormatDeleteForm.php index 0cb8729..b71eb49 100644 --- a/core/modules/system/src/Form/DateFormatDeleteForm.php +++ b/core/modules/system/src/Form/DateFormatDeleteForm.php @@ -10,7 +10,6 @@ use Drupal\Core\Datetime\DateFormatter; use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -65,7 +64,7 @@ public function getConfirmText() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('system.date_format_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php index cb2fde2..c843ba2 100644 --- a/core/modules/system/src/Form/DateFormatFormBase.php +++ b/core/modules/system/src/Form/DateFormatFormBase.php @@ -174,7 +174,6 @@ public function validate(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $form_state->setRedirect('system.date_format_list'); $form_state->setValue('pattern', trim($form_state->getValue('date_format_pattern'))); parent::submitForm($form, $form_state); } @@ -190,6 +189,7 @@ public function save(array $form, FormStateInterface $form_state) { else { drupal_set_message(t('Custom date format added.')); } + $form_state->setRedirectUrl($this->entity->urlInfo('collection')); } } diff --git a/core/modules/system/src/Tests/System/DateTimeTest.php b/core/modules/system/src/Tests/System/DateTimeTest.php index fa87fc9..f01f8c0 100644 --- a/core/modules/system/src/Tests/System/DateTimeTest.php +++ b/core/modules/system/src/Tests/System/DateTimeTest.php @@ -87,7 +87,7 @@ function testDateFormatConfiguration() { 'date_format_pattern' => $date_format, ); $this->drupalPostForm('admin/config/regional/date-time/formats/add', $edit, t('Add format')); - $this->assertUrl(\Drupal::url('system.date_format_list', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.date_format.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); $this->assertText(t('Custom date format added.'), 'Date format added confirmation message appears.'); $this->assertText($date_format_id, 'Custom date format appears in the date format list.'); $this->assertText(t('Delete'), 'Delete link for custom date format appears.'); @@ -106,13 +106,13 @@ function testDateFormatConfiguration() { 'date_format_pattern' => 'Y m', ); $this->drupalPostForm($this->getUrl(), $edit, t('Save format')); - $this->assertUrl(\Drupal::url('system.date_format_list', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.date_format.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); $this->assertText(t('Custom date format updated.'), 'Custom date format successfully updated.'); // Delete custom date format. $this->clickLink(t('Delete')); $this->drupalPostForm('admin/config/regional/date-time/formats/manage/' . $date_format_id . '/delete', array(), t('Remove')); - $this->assertUrl(\Drupal::url('system.date_format_list', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); + $this->assertUrl(\Drupal::url('entity.date_format.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); $this->assertRaw(t('Removed date format %format.', array('%format' => $name)), 'Custom date format removed.'); // Make sure the date does not exist in config. diff --git a/core/modules/system/system.links.action.yml b/core/modules/system/system.links.action.yml index c08a2cf..447a5e6 100644 --- a/core/modules/system/system.links.action.yml +++ b/core/modules/system/system.links.action.yml @@ -3,4 +3,4 @@ system.date_format_add: title: 'Add format' weight: -10 appears_on: - - system.date_format_list + - entity.date_format.collection diff --git a/core/modules/system/system.links.menu.yml b/core/modules/system/system.links.menu.yml index 1a0028f..ea07a09 100644 --- a/core/modules/system/system.links.menu.yml +++ b/core/modules/system/system.links.menu.yml @@ -94,11 +94,11 @@ system.regional_settings: description: 'Settings for the site''s default time zone and country.' route_name: system.regional_settings weight: -20 -system.date_format_list: +entity.date_format.collection: title: 'Date and time formats' parent: system.admin_config_regional description: 'Configure display format strings for date and time.' - route_name: system.date_format_list + route_name: entity.date_format.collection weight: -9 system.admin_config_search: title: 'Search and metadata' diff --git a/core/modules/system/system.links.task.yml b/core/modules/system/system.links.task.yml index 3d55647..a151835 100644 --- a/core/modules/system/system.links.task.yml +++ b/core/modules/system/system.links.task.yml @@ -55,9 +55,9 @@ system.admin_index: title: 'Index' weight: -18 -system.date_format_list: - route_name: system.date_format_list - base_route: system.date_format_list +entity.date_format.collection: + route_name: entity.date_format.collection + base_route: entity.date_format.collection title: 'List' entity.date_format.edit_form: title: 'Edit' diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 255449e..cd679c0 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -86,7 +86,7 @@ function system_help($route_name, RouteMatchInterface $route_match) { $output .= '
' . t('Performing system maintenance') . '
'; $output .= '
' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis. The System module manages this task by making use of a system cron job. You can verify the status of cron tasks by visiting the Status report page. For more information, see the online handbook entry for configuring cron jobs. You can set up cron job by visiting Cron configuration page', array('@status' => \Drupal::url('system.status'), '@handbook' => 'http://drupal.org/cron', '@cron' => \Drupal::url('system.cron_settings'))) . '
'; $output .= '
' . t('Configuring basic site settings') . '
'; - $output .= '
' . t('The System module also handles basic configuration options for your site, including Date and time settings, File system settings, Site name and other information, and a Maintenance mode for taking your site temporarily offline.', array('@date-time-settings' => \Drupal::url('system.date_format_list'), '@file-system' => \Drupal::url('system.file_system_settings'), '@site-info' => \Drupal::url('system.site_information_settings'), '@maintenance-mode' => \Drupal::url('system.site_maintenance_mode'))) . '
'; + $output .= '
' . t('The System module also handles basic configuration options for your site, including Date and time settings, File system settings, Site name and other information, and a Maintenance mode for taking your site temporarily offline.', array('@date-time-settings' => \Drupal::url('entity.date_format.collection'), '@file-system' => \Drupal::url('system.file_system_settings'), '@site-info' => \Drupal::url('system.site_information_settings'), '@maintenance-mode' => \Drupal::url('system.site_maintenance_mode'))) . '
'; $output .= '
' . t('Disabling drag-and-drop functionality') . '
'; $output .= '
' . t('The default drag-and-drop user interface for ordering tables in Drupal presents a challenge for some users, including users of screen readers and other assistive technology. The drag-and-drop interface can be disabled in a table by clicking a link labeled "Show row weights" above the table. The replacement interface allows users to order the table by choosing numerical weights instead of dragging table rows.') . '
'; $output .= '
'; @@ -1310,7 +1310,8 @@ function system_entity_type_build(array &$entity_types) { ->setFormClass('delete', 'Drupal\system\Form\DateFormatDeleteForm') ->setListBuilderClass('Drupal\system\DateFormatListBuilder') ->setLinkTemplate('edit-form', '/admin/config/regional/date-time/formats/manage/{date_format}') - ->setLinkTemplate('delete-form', '/admin/config/regional/date-time/formats/manage/{date_format}/delete'); + ->setLinkTemplate('delete-form', '/admin/config/regional/date-time/formats/manage/{date_format}/delete') + ->setLinkTemplate('collection', '/admin/config/regional/date-time/formats'); } /** diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index 77489f5..798cc89 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -220,7 +220,7 @@ system.run_cron: requirements: _permission: 'administer site configuration' -system.date_format_list: +entity.date_format.collection: path: '/admin/config/regional/date-time' defaults: _entity_list: 'date_format' diff --git a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml index 7b4ccbc..78551c6 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml +++ b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml @@ -24,7 +24,7 @@ entity.entity_test.render_no_view_mode: requirements: _access: 'TRUE' -entity.entity_test.list_referencing_entities: +entity.entity_test.collection_referencing_entities: path: '/entity_test/list/{entity_reference_field_name}/{referenced_entity_type}/{referenced_entity_id}' defaults: _controller: '\Drupal\entity_test\Controller\EntityTestController::listReferencingEntities' @@ -32,7 +32,7 @@ entity.entity_test.list_referencing_entities: requirements: _access: 'TRUE' -entity.entity_test.list_labels_alphabetically: +entity.entity_test.collection_labels_alphabetically: path: '/entity_test/list_labels_alphabetically/{entity_type_id}' defaults: _controller: '\Drupal\entity_test\Controller\EntityTestController::listEntitiesAlphabetically' @@ -40,7 +40,7 @@ entity.entity_test.list_labels_alphabetically: requirements: _access: 'TRUE' -entity.entity_test.list_empty: +entity.entity_test.collection_empty: path: '/entity_test/list_empty/{entity_type_id}' defaults: _controller: '\Drupal\entity_test\Controller\EntityTestController::listEntitiesEmpty' diff --git a/core/modules/taxonomy/src/Entity/Vocabulary.php b/core/modules/taxonomy/src/Entity/Vocabulary.php index ef831de..4f21f8a 100644 --- a/core/modules/taxonomy/src/Entity/Vocabulary.php +++ b/core/modules/taxonomy/src/Entity/Vocabulary.php @@ -40,7 +40,8 @@ * "delete-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/delete", * "reset-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/reset", * "overview-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/overview", - * "edit-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}" + * "edit-form" = "/admin/structure/taxonomy/manage/{taxonomy_vocabulary}", + * "collection" = "/admin/structure/taxonomy", * } * ) */ diff --git a/core/modules/taxonomy/src/Form/TermDeleteForm.php b/core/modules/taxonomy/src/Form/TermDeleteForm.php index 77a3644..eaccb2b 100644 --- a/core/modules/taxonomy/src/Form/TermDeleteForm.php +++ b/core/modules/taxonomy/src/Form/TermDeleteForm.php @@ -8,9 +8,6 @@ namespace Drupal\taxonomy\Form; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\ContentEntityConfirmFormBase; /** @@ -36,7 +33,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('taxonomy.vocabulary_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php index 16ae285..3f937b8 100644 --- a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php +++ b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a deletion confirmation form for taxonomy vocabulary. @@ -34,7 +33,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('taxonomy.vocabulary_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/taxonomy/src/VocabularyForm.php b/core/modules/taxonomy/src/VocabularyForm.php index fa72625..ffedfda 100644 --- a/core/modules/taxonomy/src/VocabularyForm.php +++ b/core/modules/taxonomy/src/VocabularyForm.php @@ -156,7 +156,7 @@ public function save(array $form, FormStateInterface $form_state) { case SAVED_UPDATED: drupal_set_message($this->t('Updated vocabulary %name.', array('%name' => $vocabulary->label()))); $this->logger('taxonomy')->notice('Updated vocabulary %name.', array('%name' => $vocabulary->label(), 'link' => $edit_link)); - $form_state->setRedirect('taxonomy.vocabulary_list'); + $form_state->setRedirectUrl($vocabulary->urlInfo('collection')); break; } diff --git a/core/modules/taxonomy/taxonomy.info.yml b/core/modules/taxonomy/taxonomy.info.yml index 3add22e..ceca3dd 100644 --- a/core/modules/taxonomy/taxonomy.info.yml +++ b/core/modules/taxonomy/taxonomy.info.yml @@ -7,4 +7,4 @@ core: 8.x dependencies: - node - text -configure: taxonomy.vocabulary_list +configure: entity.taxonomy_vocabulary.collection diff --git a/core/modules/taxonomy/taxonomy.links.action.yml b/core/modules/taxonomy/taxonomy.links.action.yml index 102e9b7..498c6c4 100644 --- a/core/modules/taxonomy/taxonomy.links.action.yml +++ b/core/modules/taxonomy/taxonomy.links.action.yml @@ -2,7 +2,7 @@ entity.taxonomy_vocabulary.add_form: route_name: entity.taxonomy_vocabulary.add_form title: 'Add vocabulary' appears_on: - - taxonomy.vocabulary_list + - entity.taxonomy_vocabulary.collection entity.taxonomy_term.add_form: route_name: entity.taxonomy_term.add_form diff --git a/core/modules/taxonomy/taxonomy.links.menu.yml b/core/modules/taxonomy/taxonomy.links.menu.yml index 77bb6fa..7626a2c 100644 --- a/core/modules/taxonomy/taxonomy.links.menu.yml +++ b/core/modules/taxonomy/taxonomy.links.menu.yml @@ -1,5 +1,5 @@ -taxonomy.vocabulary_list: +entity.taxonomy_vocabulary.collection: title: Taxonomy parent: system.admin_structure description: 'Manage tagging, categorization, and classification of your content.' - route_name: taxonomy.vocabulary_list + route_name: entity.taxonomy_vocabulary.collection diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 95f6a6b..7eeeb99 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -56,7 +56,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Creating vocabularies') . '
'; - $output .= '
' . t('Users with sufficient permissions can create vocabularies and terms through the Taxonomy page. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A controlled vocabulary classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => \Drupal::url('taxonomy.vocabulary_list'), '@perm' => \Drupal::url('user.admin_permissions', [], array('fragment'=>'module-taxonomy')))); + $output .= '
' . t('Users with sufficient permissions can create vocabularies and terms through the Taxonomy page. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A controlled vocabulary classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => \Drupal::url('entity.taxonomy_vocabulary.collection'), '@perm' => \Drupal::url('user.admin_permissions', [], array('fragment'=>'module-taxonomy')))); $output .= '
'; $output .= '
' . t('Terms in a free-tagging vocabulary can be built gradually as you create or edit content. This is often done used for blogs or photo management applications.') . '
'; $output .= '
' . t('Assigning vocabularies to content types') . '
'; - $output .= '
' . t('Before you can use a new vocabulary to classify your content, a new Taxonomy term field must be added to a content type on its manage fields page. When adding a taxonomy field, you choose a widget to use to enter the taxonomy information on the content editing page: a select list, checkboxes, radio buttons, or an auto-complete field (to build a free-tagging vocabulary). After choosing the field type and widget, on the subsequent field settings page you can choose the desired vocabulary, whether one or multiple terms can be chosen from the vocabulary, and other settings. The same vocabulary can be added to multiple content types, by using the "Re-use existing field" section on the manage fields page.', array('@ctedit' => \Drupal::url('node.overview_types'))) . '
'; + $output .= '
' . t('Before you can use a new vocabulary to classify your content, a new Taxonomy term field must be added to a content type on its manage fields page. When adding a taxonomy field, you choose a widget to use to enter the taxonomy information on the content editing page: a select list, checkboxes, radio buttons, or an auto-complete field (to build a free-tagging vocabulary). After choosing the field type and widget, on the subsequent field settings page you can choose the desired vocabulary, whether one or multiple terms can be chosen from the vocabulary, and other settings. The same vocabulary can be added to multiple content types, by using the "Re-use existing field" section on the manage fields page.', array('@ctedit' => \Drupal::url('entity.node_type.collection'))) . '
'; $output .= '
' . t('Classifying content') . '
'; $output .= '
' . t('After the vocabulary is assigned to the content type, you can start classifying content. The field with terms will appear on the content editing screen when you edit or add new content.', array('@addnode' => \Drupal::url('node.add_page'))) . '
'; $output .= '
' . t('Viewing listings') . '
'; @@ -77,7 +77,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { $output .= '
'; return $output; - case 'taxonomy.vocabulary_list': + case 'entity.taxonomy_vocabulary.collection': $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' => '', '#tree' => TRUE); @@ -130,7 +130,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { drupal_set_message($message, $redirect ? 'error' : 'warning'); // If only user 1 was selected, redirect to the overview. if ($redirect) { - return $this->redirect('user.admin_account'); + return $this->redirect('entity.user.collection'); } } @@ -197,7 +197,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { } } } - $form_state->setRedirect('user.admin_account'); + $form_state->setRedirect('entity.user.collection'); } } diff --git a/core/modules/user/src/Form/UserRoleDelete.php b/core/modules/user/src/Form/UserRoleDelete.php index 12d9662..aa0f7d2 100644 --- a/core/modules/user/src/Form/UserRoleDelete.php +++ b/core/modules/user/src/Form/UserRoleDelete.php @@ -9,7 +9,6 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; /** * Provides a deletion confirmation form for Role entity. @@ -27,7 +26,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('user.role_list'); + return $this->entity->urlInfo('collection'); } /** diff --git a/core/modules/user/src/RoleForm.php b/core/modules/user/src/RoleForm.php index b05c164..bb801ea 100644 --- a/core/modules/user/src/RoleForm.php +++ b/core/modules/user/src/RoleForm.php @@ -68,7 +68,7 @@ public function save(array $form, FormStateInterface $form_state) { drupal_set_message($this->t('Role %label has been added.', array('%label' => $entity->label()))); $this->logger('user')->notice('Role %label has been added.', array('%label' => $entity->label(), 'link' => $edit_link)); } - $form_state->setRedirect('user.role_list'); + $form_state->setRedirect('entity.user_role.collection'); } } diff --git a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php index b58f86b..7ecc24b 100644 --- a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php +++ b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php @@ -35,9 +35,9 @@ public function testUserAdminLocalTasks($route, $expected) { */ public function getUserAdminRoutes() { return array( - array('user.admin_account', array(array('user.admin_account', 'user.admin_permissions', 'user.role_list'))), - array('user.admin_permissions', array(array('user.admin_account', 'user.admin_permissions', 'user.role_list'))), - array('user.role_list', array(array('user.admin_account', 'user.admin_permissions', 'user.role_list'))), + array('entity.user.collection', array(array('entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection'))), + array('user.admin_permissions', array(array('entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection'))), + array('entity.user_role.collection', array(array('entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection'))), array('entity.user.admin_form', array(array('user.account_settings_tab'))), ); } diff --git a/core/modules/user/user.links.action.yml b/core/modules/user/user.links.action.yml index 2a1f892..901c790 100644 --- a/core/modules/user/user.links.action.yml +++ b/core/modules/user/user.links.action.yml @@ -2,9 +2,9 @@ user_admin_create: route_name: user.admin_create title: 'Add user' appears_on: - - user.admin_account + - entity.user.collection user.role_add: route_name: user.role_add title: 'Add role' appears_on: - - user.role_list + - entity.user_role.collection diff --git a/core/modules/user/user.links.menu.yml b/core/modules/user/user.links.menu.yml index 62cfe51..46a2947 100644 --- a/core/modules/user/user.links.menu.yml +++ b/core/modules/user/user.links.menu.yml @@ -8,9 +8,9 @@ user.logout: route_name: user.logout weight: 10 menu_name: account -user.admin_account: +entity.user.collection: title: People - route_name: user.admin_account + route_name: entity.user.collection description: 'Manage user accounts, roles, and permissions.' parent: system.admin weight: 4 diff --git a/core/modules/user/user.links.task.yml b/core/modules/user/user.links.task.yml index 9d9661d..00086a8 100644 --- a/core/modules/user/user.links.task.yml +++ b/core/modules/user/user.links.task.yml @@ -37,18 +37,18 @@ entity.user.edit_form: base_route: entity.user.canonical title: Edit -user.admin_account: +entity.user.collection: title: List - route_name: user.admin_account - base_route: user.admin_account + route_name: entity.user.collection + base_route: entity.user.collection user.admin_permissions: title: Permissions route_name: user.admin_permissions - base_route: user.admin_account + base_route: entity.user.collection -user.role_list: +entity.user_role.collection: title: 'Roles' - route_name: user.role_list - base_route: user.admin_account + route_name: entity.user_role.collection + base_route: entity.user.collection weight: 10 diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 38f0ba0..82d5473 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -54,9 +54,9 @@ function user_help($route_name, RouteMatchInterface $route_match) { $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Creating and managing users') . '
'; - $output .= '
' . t('Through the People administration page you can add and cancel user accounts and assign users to roles. By editing one particular user you can change their username, email address, password, and information in other fields.', array('!people' => \Drupal::url('user.admin_account'))) . '
'; + $output .= '
' . t('Through the People administration page you can add and cancel user accounts and assign users to roles. By editing one particular user you can change their username, email address, password, and information in other fields.', array('!people' => \Drupal::url('entity.user.collection'))) . '
'; $output .= '
' . t('Configuring user roles') . '
'; - $output .= '
' . t('Roles are used to group and classify users; each user can be assigned one or more roles. Typically there are two pre-defined roles: Anonymous user (users that are not logged in), and Authenticated user (users that are registered and logged in). Depending on how your site was set up, an Administrator role may also be available: users with this role will automatically be assigned any new permissions whenever a module is enabled. You can create additional roles on the Roles administration page.', array('!roles' => \Drupal::url('user.role_list'))) . '
'; + $output .= '
' . t('Roles are used to group and classify users; each user can be assigned one or more roles. Typically there are two pre-defined roles: Anonymous user (users that are not logged in), and Authenticated user (users that are registered and logged in). Depending on how your site was set up, an Administrator role may also be available: users with this role will automatically be assigned any new permissions whenever a module is enabled. You can create additional roles on the Roles administration page.', array('!roles' => \Drupal::url('entity.user_role.collection'))) . '
'; $output .= '
' . t('Setting permissions') . '
'; $output .= '
' . t('After creating roles, you can set permissions for each role on the Permissions page. Granting a permission allows users who have been assigned a particular role to perform an action on the site, such as viewing content, editing or creating a particular type of content, administering settings for a particular module, or using a particular function of the site (such as search).', array('!permissions_user' => \Drupal::url('user.admin_permissions'))) . '
'; $output .= '
' . t('Managing account settings') . '
'; @@ -70,9 +70,9 @@ function user_help($route_name, RouteMatchInterface $route_match) { return '

' . 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 .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Creating and managing views.') . '
'; - $output .= '
' . t('Views can be created from the Views list page by using the "Add new view" action. Existing views can be managed from the Views list page by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".', array('@list' => \Drupal::url('views_ui.list', array('name' => 'views_ui')))) . '
'; + $output .= '
' . t('Views can be created from the Views list page by using the "Add new view" action. Existing views can be managed from the Views list page by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".', array('@list' => \Drupal::url('entity.view.collection', array('name' => 'views_ui')))) . '
'; $output .= '
' . t('Enabling and disabling views.') . '
'; - $output .= '
' . t('Views can be enabled or disabled from the Views list page. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.', array('@list' => \Drupal::url('views_ui.list', array('name' => 'views_ui')))) . '
'; + $output .= '
' . t('Views can be enabled or disabled from the Views list page. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.', array('@list' => \Drupal::url('entity.view.collection', array('name' => 'views_ui')))) . '
'; $output .= '
' . t('Exporting and importing views.') . '
'; $output .= '
' . t('Views can be exported and imported as configuration files by using the Configuration Manager module.', array('@config' => \Drupal::url('help.page', array('name' => 'config')))) . '
'; $output .= '
' . t('Theming views.') . '
'; @@ -60,7 +60,8 @@ function views_ui_entity_type_build(array &$entity_types) { ->setLinkTemplate('delete-form', '/admin/structure/views/view/{view}/delete') ->setLinkTemplate('enable', '/admin/structure/views/view/{view}/enable') ->setLinkTemplate('disable', '/admin/structure/views/view/{view}/disable') - ->setLinkTemplate('break-lock-form', '/admin/structure/views/view/{view}/break-lock'); + ->setLinkTemplate('break-lock-form', '/admin/structure/views/view/{view}/break-lock') + ->setLinkTemplate('collection', '/admin/structure/views'); } /** diff --git a/core/modules/views_ui/views_ui.routing.yml b/core/modules/views_ui/views_ui.routing.yml index 43e3634..0b95812 100644 --- a/core/modules/views_ui/views_ui.routing.yml +++ b/core/modules/views_ui/views_ui.routing.yml @@ -1,4 +1,4 @@ -views_ui.list: +entity.view.collection: path: '/admin/structure/views' defaults: _entity_list: 'view'