diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index d01759f..770e229 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -43,10 +43,11 @@ * }, * bundle_entity_type = "taxonomy_vocabulary", * links = { - * "canonical" = "taxonomy.term_page", - * "delete-form" = "taxonomy.term_delete", - * "edit-form" = "taxonomy.term_edit", - * "admin-form" = "taxonomy.overview_terms" + * "canonical" = "entity.taxonomy_term.canonical", + * "delete-form" = "entity.taxonomy_term.delete_form", + * "edit-form" = "entity.taxonomy_term.edit_form", + * "admin-form" = "entity.taxonomy_term.admin_form", + * "add-form" = "entity.taxonomy_term.add_form", * }, * permission_granularity = "bundle" * ) diff --git a/core/modules/taxonomy/src/Entity/Vocabulary.php b/core/modules/taxonomy/src/Entity/Vocabulary.php index 3927c34..4875575 100644 --- a/core/modules/taxonomy/src/Entity/Vocabulary.php +++ b/core/modules/taxonomy/src/Entity/Vocabulary.php @@ -35,11 +35,11 @@ * "weight" = "weight" * }, * links = { - * "add-form" = "taxonomy.term_add", - * "delete-form" = "taxonomy.vocabulary_delete", + * "add-form" = "entity.taxonomy_vocabulary.add_form", + * "delete-form" = "entity.taxonomy_vocabulary.delete_form", * "reset" = "taxonomy.vocabulary_reset", - * "overview-form" = "taxonomy.overview_terms", - * "edit-form" = "taxonomy.vocabulary_edit" + * "overview-form" = "entity.taxonomy_term.admin_form", + * "edit-form" = "entity.taxonomy_vocabulary.edit_form" * } * ) */ diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php index 88addad..8b60f70 100644 --- a/core/modules/taxonomy/src/Form/OverviewTerms.php +++ b/core/modules/taxonomy/src/Form/OverviewTerms.php @@ -195,7 +195,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular $form['terms'] = array( '#type' => 'table', '#header' => array($this->t('Name'), $this->t('Weight'), $this->t('Operations')), - '#empty' => $this->t('No terms available. Add term.', array('@link' => $this->url('taxonomy.term_add', array('taxonomy_vocabulary' => $taxonomy_vocabulary->id())))), + '#empty' => $this->t('No terms available. Add term.', array('@link' => $this->url('entity.taxonomy_term.add_form', array('taxonomy_vocabulary' => $taxonomy_vocabulary->id())))), '#attributes' => array( 'id' => 'taxonomy', ), diff --git a/core/modules/taxonomy/src/TermBreadcrumbBuilder.php b/core/modules/taxonomy/src/TermBreadcrumbBuilder.php index a14041b..28a7087 100644 --- a/core/modules/taxonomy/src/TermBreadcrumbBuilder.php +++ b/core/modules/taxonomy/src/TermBreadcrumbBuilder.php @@ -23,7 +23,7 @@ class TermBreadcrumbBuilder implements BreadcrumbBuilderInterface { * {@inheritdoc} */ public function applies(RouteMatchInterface $route_match) { - return $route_match->getRouteName() == 'taxonomy.term_page' + return $route_match->getRouteName() == 'entity.taxonomy_term.canonical' && $route_match->getParameter('taxonomy_term') instanceof TermInterface; } @@ -38,7 +38,7 @@ public function build(RouteMatchInterface $route_match) { $breadcrumb = array(); while ($parents = taxonomy_term_load_parents($term->id())) { $term = array_shift($parents); - $breadcrumb[] = $this->l($term->getName(), 'taxonomy.term_page', array('taxonomy_term' => $term->id())); + $breadcrumb[] = $this->l($term->getName(), 'entity.taxonomy_term.canonical', array('taxonomy_term' => $term->id())); } $breadcrumb[] = $this->l($this->t('Home'), ''); $breadcrumb = array_reverse($breadcrumb); diff --git a/core/modules/taxonomy/taxonomy.links.action.yml b/core/modules/taxonomy/taxonomy.links.action.yml index 689754a..1b93140 100644 --- a/core/modules/taxonomy/taxonomy.links.action.yml +++ b/core/modules/taxonomy/taxonomy.links.action.yml @@ -1,11 +1,11 @@ taxonomy_add_vocabulary_local_action: - route_name: taxonomy.vocabulary_add + route_name: entity.taxonomy_vocabulary.add_form title: 'Add vocabulary' appears_on: - taxonomy.vocabulary_list taxonomy.term_add: - route_name: taxonomy.term_add + route_name: entity.taxonomy_term.add_form title: 'Add term' appears_on: - - taxonomy.overview_terms + - entity.taxonomy_term.admin_form diff --git a/core/modules/taxonomy/taxonomy.links.contextual.yml b/core/modules/taxonomy/taxonomy.links.contextual.yml index 3fafba7..f0f1769 100644 --- a/core/modules/taxonomy/taxonomy.links.contextual.yml +++ b/core/modules/taxonomy/taxonomy.links.contextual.yml @@ -1,17 +1,17 @@ taxonomy.term_edit: title: Edit group: taxonomy_term - route_name: taxonomy.term_edit + route_name: entity.taxonomy_term.edit_form weight: 10 taxonomy.term_delete: title: Delete group: taxonomy_term - route_name: taxonomy.term_delete + route_name: entity.taxonomy_term.delete_form weight: 20 taxonomy.vocabulary_delete: title: Delete group: taxonomy_vocabulary - route_name: taxonomy.vocabulary_delete + route_name: entity.taxonomy_vocabulary.delete_form weight: 20 diff --git a/core/modules/taxonomy/taxonomy.links.task.yml b/core/modules/taxonomy/taxonomy.links.task.yml index 461d762..a0bc9f7 100644 --- a/core/modules/taxonomy/taxonomy.links.task.yml +++ b/core/modules/taxonomy/taxonomy.links.task.yml @@ -1,18 +1,19 @@ -taxonomy.term_page: +entity.taxonomy_term.canonical: title: 'View' - route_name: taxonomy.term_page - base_route: taxonomy.term_page + route_name: entity.taxonomy_term.canonical + base_route: entity.taxonomy_term.canonical -taxonomy.term_edit: +entity.taxonomy_term.edit_form: title: 'Edit' - route_name: taxonomy.term_edit - base_route: taxonomy.term_page + route_name: entity.taxonomy_term.edit_form + base_route: entity.taxonomy_term.canonical -taxonomy.overview_terms: +entity.taxonomy_term.admin_form: title: 'List' - route_name: taxonomy.overview_terms - base_route: taxonomy.overview_terms -taxonomy.vocabulary_edit: + route_name: entity.taxonomy_term.admin_form + base_route: entity.taxonomy_term.admin_form + +entity.taxonomy_vocabulary.edit_form: title: 'Edit' - route_name: taxonomy.vocabulary_edit - base_route: taxonomy.overview_terms + route_name: entity.taxonomy_vocabulary.edit_form + base_route: entity.taxonomy_term.admin_form diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 3058dc3..1606edb 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -79,7 +79,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) { $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; - case 'taxonomy.overview_terms': + case 'entity.taxonomy_term.admin_form': $vocabulary = $route_match->getParameter('taxonomy_vocabulary'); switch ($vocabulary->hierarchy) { case TAXONOMY_HIERARCHY_DISABLED: @@ -120,7 +120,7 @@ function taxonomy_permission() { * Entity URI callback. */ function taxonomy_term_uri($term) { - return new Url('taxonomy.term_page', array( + return new Url('entity.taxonomy_term.canonical', array( 'taxonomy_term' => $term->id(), )); } diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 1182589..14e4afc 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -6,7 +6,7 @@ taxonomy.vocabulary_list: requirements: _permission: 'administer taxonomy' -taxonomy.term_add: +entity.taxonomy_term.add_form: path: '/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/add' defaults: _content: '\Drupal\taxonomy\Controller\TaxonomyController::addForm' @@ -14,7 +14,7 @@ taxonomy.term_add: requirements: _entity_create_access: 'taxonomy_term:{taxonomy_vocabulary}' -taxonomy.term_edit: +entity.taxonomy_term.edit_form: path: '/taxonomy/term/{taxonomy_term}/edit' defaults: _entity_form: 'taxonomy_term.default' @@ -24,7 +24,7 @@ taxonomy.term_edit: requirements: _entity_access: 'taxonomy_term.update' -taxonomy.term_delete: +entity.taxonomy_term.delete_form: path: '/taxonomy/term/{taxonomy_term}/delete' defaults: _entity_form: 'taxonomy_term.delete' @@ -34,7 +34,7 @@ taxonomy.term_delete: requirements: _entity_access: 'taxonomy_term.delete' -taxonomy.vocabulary_add: +entity.taxonomy_vocabulary.add_form: path: '/admin/structure/taxonomy/add' defaults: _entity_form: 'taxonomy_vocabulary' @@ -42,7 +42,7 @@ taxonomy.vocabulary_add: requirements: _entity_create_access: 'taxonomy_vocabulary' -taxonomy.vocabulary_edit: +entity.taxonomy_vocabulary.edit_form: path: '/admin/structure/taxonomy/manage/{taxonomy_vocabulary}' defaults: _entity_form: 'taxonomy_vocabulary.default' @@ -50,7 +50,7 @@ taxonomy.vocabulary_edit: requirements: _entity_access: 'taxonomy_vocabulary.update' -taxonomy.vocabulary_delete: +entity.taxonomy_vocabulary.delete_form: path: '/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/delete' defaults: _entity_form: 'taxonomy_vocabulary.delete' @@ -80,7 +80,7 @@ taxonomy.autocomplete_vid: requirements: _permission: 'access content' -taxonomy.overview_terms: +entity.taxonomy_term.admin_form: path: '/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/overview' defaults: _form: 'Drupal\taxonomy\Form\OverviewTerms' @@ -88,7 +88,7 @@ taxonomy.overview_terms: requirements: _entity_access: 'taxonomy_vocabulary.view' -taxonomy.term_page: +entity.taxonomy_term.canonical: path: '/taxonomy/term/{taxonomy_term}' defaults: _content: '\Drupal\taxonomy\Controller\TaxonomyController::termPage' diff --git a/core/modules/taxonomy/tests/src/Menu/TaxonomyLocalTasksTest.php b/core/modules/taxonomy/tests/src/Menu/TaxonomyLocalTasksTest.php index afb8f3c..0a6f031 100644 --- a/core/modules/taxonomy/tests/src/Menu/TaxonomyLocalTasksTest.php +++ b/core/modules/taxonomy/tests/src/Menu/TaxonomyLocalTasksTest.php @@ -28,7 +28,7 @@ public function setUp() { */ public function testTaxonomyPageLocalTasks($route, $subtask = array()) { $tasks = array( - 0 => array('taxonomy.term_page', 'taxonomy.term_edit'), + 0 => array('entity.taxonomy_term.canonical', 'entity.taxonomy_term.edit_form'), ); if ($subtask) $tasks[] = $subtask; $this->assertLocalTasks($route, $tasks); @@ -39,8 +39,8 @@ public function testTaxonomyPageLocalTasks($route, $subtask = array()) { */ public function getTaxonomyPageRoutes() { return array( - array('taxonomy.term_page'), - array('taxonomy.term_edit'), + array('entity.taxonomy_term.canonical'), + array('entity.taxonomy_term.edit_form'), ); }