Loading core/modules/taxonomy/src/VocabularyListBuilder.php +3 −2 Original line number Diff line number Diff line Loading @@ -109,6 +109,9 @@ public function getDefaultOperations(EntityInterface $entity) { if (isset($operations['edit'])) { $operations['edit']['title'] = t('Edit vocabulary'); } if (isset($operations['delete'])) { $operations['delete']['title'] = $this->t('Delete vocabulary'); } if ($entity->access('access taxonomy overview')) { $operations['list'] = [ Loading @@ -127,8 +130,6 @@ public function getDefaultOperations(EntityInterface $entity) { ]; } unset($operations['delete']); return $operations; } Loading core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php +13 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,19 @@ public function testVocabularyInterface() { $site_name = $this->config('system.site')->get('name'); $this->assertSession()->titleEquals("Don't Panic | $site_name"); // Delete the vocabulary. $this->drupalGet('admin/structure/taxonomy'); $this->assertSession()->linkByHrefExists(Url::fromRoute('entity.taxonomy_vocabulary.delete_form', ['taxonomy_vocabulary' => $edit['vid']])->toString()); $this->clickLink(t('Delete vocabulary')); $this->assertSession()->responseContains(t('Are you sure you want to delete the vocabulary %name?', ['%name' => $edit['name']])); $this->assertSession()->pageTextContains(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.')); // Confirm deletion. $this->submitForm([], 'Delete'); $this->assertSession()->responseContains(t('Deleted vocabulary %name.', ['%name' => $edit['name']])); $this->container->get('entity_type.manager')->getStorage('taxonomy_vocabulary')->resetCache(); $this->assertNull(Vocabulary::load($edit['vid']), 'Vocabulary not found.'); } /** Loading Loading
core/modules/taxonomy/src/VocabularyListBuilder.php +3 −2 Original line number Diff line number Diff line Loading @@ -109,6 +109,9 @@ public function getDefaultOperations(EntityInterface $entity) { if (isset($operations['edit'])) { $operations['edit']['title'] = t('Edit vocabulary'); } if (isset($operations['delete'])) { $operations['delete']['title'] = $this->t('Delete vocabulary'); } if ($entity->access('access taxonomy overview')) { $operations['list'] = [ Loading @@ -127,8 +130,6 @@ public function getDefaultOperations(EntityInterface $entity) { ]; } unset($operations['delete']); return $operations; } Loading
core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php +13 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,19 @@ public function testVocabularyInterface() { $site_name = $this->config('system.site')->get('name'); $this->assertSession()->titleEquals("Don't Panic | $site_name"); // Delete the vocabulary. $this->drupalGet('admin/structure/taxonomy'); $this->assertSession()->linkByHrefExists(Url::fromRoute('entity.taxonomy_vocabulary.delete_form', ['taxonomy_vocabulary' => $edit['vid']])->toString()); $this->clickLink(t('Delete vocabulary')); $this->assertSession()->responseContains(t('Are you sure you want to delete the vocabulary %name?', ['%name' => $edit['name']])); $this->assertSession()->pageTextContains(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.')); // Confirm deletion. $this->submitForm([], 'Delete'); $this->assertSession()->responseContains(t('Deleted vocabulary %name.', ['%name' => $edit['name']])); $this->container->get('entity_type.manager')->getStorage('taxonomy_vocabulary')->resetCache(); $this->assertNull(Vocabulary::load($edit['vid']), 'Vocabulary not found.'); } /** Loading