diff --git a/core/modules/taxonomy/src/Entity/Vocabulary.php b/core/modules/taxonomy/src/Entity/Vocabulary.php index 4875575..1265fd1 100644 --- a/core/modules/taxonomy/src/Entity/Vocabulary.php +++ b/core/modules/taxonomy/src/Entity/Vocabulary.php @@ -35,9 +35,9 @@ * "weight" = "weight" * }, * links = { - * "add-form" = "entity.taxonomy_vocabulary.add_form", + * "add-form" = "entity.taxonomy_term.add_form", * "delete-form" = "entity.taxonomy_vocabulary.delete_form", - * "reset" = "taxonomy.vocabulary_reset", + * "reset-form" = "entity.taxonomy_vocabulary.reset_form", * "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 50ff5c3..9099835 100644 --- a/core/modules/taxonomy/src/Form/OverviewTerms.php +++ b/core/modules/taxonomy/src/Form/OverviewTerms.php @@ -452,7 +452,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { public function submitReset(array &$form, FormStateInterface $form_state) { /** @var $vocabulary \Drupal\taxonomy\VocabularyInterface */ $vocabulary = $form_state['taxonomy']['vocabulary']; - $form_state->setRedirectUrl($vocabulary->urlInfo('reset')); + $form_state->setRedirectUrl($vocabulary->urlInfo('reset-form')); } } diff --git a/core/modules/taxonomy/src/Form/VocabularyResetForm.php b/core/modules/taxonomy/src/Form/VocabularyResetForm.php index b129262..060b243 100644 --- a/core/modules/taxonomy/src/Form/VocabularyResetForm.php +++ b/core/modules/taxonomy/src/Form/VocabularyResetForm.php @@ -85,7 +85,7 @@ public function save(array $form, FormStateInterface $form_state) { $this->termStorage->resetWeights($this->entity->id()); drupal_set_message($this->t('Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label()))); $this->logger('taxonomy')->notice('Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label())); - $form_state->setRedirectUrl($this->entity->urlInfo('edit-form')); + $form_state->setRedirectUrl($this->getCancelUrl()); } } diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php index 8886654..ec74069 100644 --- a/core/modules/taxonomy/src/Tests/TermTest.php +++ b/core/modules/taxonomy/src/Tests/TermTest.php @@ -470,6 +470,8 @@ function testTermReorder() { $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview', array(), t('Reset to alphabetical')); // Submit confirmation form. $this->drupalPostForm(NULL, array(), t('Reset to alphabetical')); + // Ensure form redirected back to overview. + $this->assertUrl('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview'); drupal_static_reset('taxonomy_get_tree'); drupal_static_reset('taxonomy_get_treeparent'); diff --git a/core/modules/taxonomy/taxonomy.links.action.yml b/core/modules/taxonomy/taxonomy.links.action.yml index 1b93140..6e45293 100644 --- a/core/modules/taxonomy/taxonomy.links.action.yml +++ b/core/modules/taxonomy/taxonomy.links.action.yml @@ -1,10 +1,10 @@ -taxonomy_add_vocabulary_local_action: +entity.taxonomy_vocabulary.add_form: route_name: entity.taxonomy_vocabulary.add_form title: 'Add vocabulary' appears_on: - taxonomy.vocabulary_list -taxonomy.term_add: +entity.taxonomy_term.add_form: route_name: entity.taxonomy_term.add_form title: 'Add term' appears_on: diff --git a/core/modules/taxonomy/taxonomy.links.contextual.yml b/core/modules/taxonomy/taxonomy.links.contextual.yml index f0f1769..7f8ce51 100644 --- a/core/modules/taxonomy/taxonomy.links.contextual.yml +++ b/core/modules/taxonomy/taxonomy.links.contextual.yml @@ -1,16 +1,16 @@ -taxonomy.term_edit: +entity.taxonomy_term.edit_form: title: Edit group: taxonomy_term route_name: entity.taxonomy_term.edit_form weight: 10 -taxonomy.term_delete: +entity.taxonomy_term.delete_form: title: Delete group: taxonomy_term route_name: entity.taxonomy_term.delete_form weight: 20 -taxonomy.vocabulary_delete: +entity.taxonomy_vocabulary.delete_form: title: Delete group: taxonomy_vocabulary route_name: entity.taxonomy_vocabulary.delete_form diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 14e4afc..962bf52 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -58,7 +58,7 @@ entity.taxonomy_vocabulary.delete_form: requirements: _entity_access: 'taxonomy_vocabulary.delete' -taxonomy.vocabulary_reset: +entity.taxonomy_vocabulary.reset_form: path: '/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/reset' defaults: _entity_form: 'taxonomy_vocabulary.reset'