Problem/Motivation

Vocabulary listing is not showing delete operation for vocabularies. Looking at the code it seems that the lack of such operation is intentional but I do not understand why. Add the delete operation link would be very useful

Proposed resolution

Add delete operation for vocabularies on vocabulary listing page.

Remaining tasks

Make a patch.

User interface changes

It will add the delete vocabulary link in operations links on vocabulary listing.

API changes

none.

Comments

willzyx’s picture

willzyx’s picture

Issue summary: View changes
StatusFileSize
new35.91 KB
jibran’s picture

+++ b/core/modules/taxonomy/src/VocabularyListBuilder.php
@@ -51,7 +51,6 @@ public function getDefaultOperations(EntityInterface $entity) {
-    unset($operations['delete']);

I think it's there for a reason. I'm not sure about the reason maybe @Berdir should know.

willzyx’s picture

I looked #1891690: Use EntityListController for vocabularies (which introduced the class) but there seems to be no reference to why the delete operation should not be shown

jibran’s picture

+++ b/core/modules/taxonomy/taxonomy.admin.inc
@@ -9,88 +9,6 @@
-    $links = array();
-    $links['edit'] = array(
-      'title' => t('edit vocabulary'),
-      'href' => "admin/structure/taxonomy/manage/{$vocabulary->id()}/edit",
-    );
-    $links['list'] = array(
-      'title' => t('list terms'),
-      'href' => "admin/structure/taxonomy/manage/{$vocabulary->id()}",
-    );
-    $links['add'] = array(
-      'title' => t('add terms'),
-      'href' => "admin/structure/taxonomy/manage/{$vocabulary->id()}/add",
-    );
-    $form['vocabularies'][$vocabulary->id()]['operations'] = array(
-      '#type' => 'operations',
-      '#links' => $links,
-    );

Coming from #1891690-25: Use EntityListController for vocabularies the delete operation was never really there. Maybe we need to dig deeper. Can you please find the issue in which above code got added?

willzyx’s picture

I'm not sure but I think the code you've reported was inherited from drupal 7 (taxonomy_overview_vocabularies() contains very similar code); since in d8 things have changed a lot and now that the operation is automatically added by EntityListBuilder I do not think there is a reason to remove the delete operation.

willzyx’s picture

Category: Bug report » Feature request

Given that the delete operation for vocabularies was not present in 7.x and in the previous versions of and 8.x, should we categorize this issue as a feature request?
is a one-line patch and add the delete operation link would be very useful

umarzaffer’s picture

While reviewing this I:
1. Downloaded and applied the patch.
2. After applying patch, the 'Delete' option against vocabularies on listing page is visible and works as expected.
3. Have created a new patch with minor improvements.

umarzaffer’s picture

Issue tags: +SrijanSprintDay
RavindraSingh’s picture

Assigned: Unassigned » RavindraSingh
RavindraSingh’s picture

Issue tags: +Needs tests
StatusFileSize
new111.75 KB

Good work @umarzaffer,

I have applied the patch manually, working as expected. Attached is the screenshot
Delete Vacubs

I am still keeping the status in "needs review", beacuse I am not sure if it requires "tests".

umarzaffer’s picture

Assigned: RavindraSingh » Unassigned

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

borisson_’s picture

Status: Needs review » Needs work

It does still require tests. The patch also needs a reroll.

idebr’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new2.3 KB
  1. Rerolled the patch
  2. Added assertions to \Drupal\Tests\taxonomy\Functional\VocabularyUiTest::testVocabularyInterface()

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
ranjith_kumar_k_u’s picture

StatusFileSize
new2.24 KB

Re-rolled #20 for 9.4

Status: Needs review » Needs work

The last submitted patch, 26: 2469545-26.patch, failed testing. View results

yogeshmpawar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.25 KB
new818 bytes

Updated patch will fix the test failures.

Status: Needs review » Needs work

The last submitted patch, 28: 2469545-28.patch, failed testing. View results

yogeshmpawar’s picture

Version: 9.3.x-dev » 9.4.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.23 KB
new926 bytes

One more try to fix test failures. removed deprecated drupalPostForm() method.

vinodhini.e’s picture

I applied patch #30, It's working for me.
I am attaching a screenshot before and after applying the patch.

Thanks.

dilliganesh’s picture

StatusFileSize
new99.96 KB
new113.64 KB
new44.78 KB

I've tested #30 in 9.4.x version working fine as expected. Attached the screenshot

vengadesan_s’s picture

StatusFileSize
new163.11 KB
new188.34 KB

I applied patch #30, It's works as required. Attached screenshots please check.

vinodhini.e’s picture

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nayana_mvr’s picture

StatusFileSize
new215.18 KB
new261.66 KB

Verified the patch #30 and tested it on Drupal version 10.1.x. The patch works fine in 10.1.x also and I have added the before and after screenshots for reference.

Before patch
Before-patch

After patch
After-patch

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

FYI #31 provided screenshots so any following screenshots were duplicative work and not needed.

Testing the code I get the same as everyone else.

Test coverage seems correct and covers the use case.

Looks fine.

  • lauriii committed cd94d19d on 10.1.x
    Issue #2469545 by yogeshmpawar, willzyx, umarzaffer, idebr,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed cd94d19 and pushed to 10.1.x. Thanks!

smustgrave’s picture

Fyi this just caused a random failure in #2613222: Language module shouldn't alter config in sync mode

smustgrave’s picture

Also relooking at the patch I see t() used in the tests. Should we open a follow up to remove?

  • lauriii committed 29456100 on 10.1.x
    Revert "Issue #2469545 by yogeshmpawar, willzyx, umarzaffer, idebr,...
lauriii’s picture

Status: Fixed » Needs work

The order of the taxonomy terms on the page is not deterministic and that's what's causing the random fails. Reverting for that, and so we can also clean up #42.

lauriii’s picture

Status: Needs work » Needs review
StatusFileSize
new2.49 KB
new2.02 KB

This should address the random failure and #42.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Perfect!

  • catch committed d2bf0de1 on 10.1.x
    Issue #2469545 by yogeshmpawar, willzyx, umarzaffer, lauriii, idebr,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed d2bf0de and pushed to 10.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.