Orphan taxonomy terms are deleted without notification

Created on 1 September 2012, about 12 years ago
Updated 7 February 2024, 10 months ago

Problem/Motivation

A child taxonomy term is automatically deleted when it only has one parent term and that parent is deleted. In one delete submission, multiple terms can be deleted, but the user is never fully informed of the deleted terms. Neither before or after confirmation of the deletion. In this situation, users might not realize which terms are actually deleted.

After completion of the operation, the produced log notice only include the root deleted term. Leaving no trace to help a confused user who don;t understand why a term he did not delete disappeared.

When the user is asked to confirm the deletion of a taxonomy term, a confusing "" is displayed. This message is confusing because:

  • On the confirmation page, the user has no way to known if the term as any children.
  • The deletion is recursive (all descendants are affected, not just direct children). But the message usage of "children" fail to acknowledge it.
  • Any child of a deleted descendants that has a non-deleted parents will not be deleted. But the message fail to inform the user that some descendants may bot be deleted.

What behavior were you expecting?
Before confirmation of the operation, the user should be presented with a list of all taxonomy terms that will be deleted.
On completion of the delete operation, a confirmation message including the list of all the deleted taxonomy terms, and a matching log notice.

What happened instead?
Before confirmation of the operation, a confusing "Deleting a term will delete all its children if there are any. This action cannot be undone." message.
One confirmation message reading "Deleted term Term1" with a matching log notice.

Steps to reproduce

  1. Create a taxonomy term, Term1
  2. Create another taxonomy term, Term2, whose parent is Term1
  3. Delete Term1 (Term2 will then be deleted)

Proposed resolution

Override the methods used for confirmation messages and log to include the complete list of deleted terms.

Remaining tasks

  • Please review the attached patch and make suggestions as necessary.
  • Tests are needed.

Add links to before and after screenshots in the next section so the reviewer can find the latest ones.

User interface changes

Before

TBA

After

TBA

API changes

Data model changes

Release notes snippet

Note: Original reporter, @guschilds, came across this issue when debugging #726490: Taxonomy term record for term with multiple parents is not deleted when parent is deleted .

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Taxonomy 

Last updated about 5 hours ago

  • Maintained by
  • 🇺🇸United States @xjm
  • 🇬🇧United Kingdom @catch
Created by

🇺🇸United States guschilds

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India shalini_jha

    I have able to reproduce the issues by following the steps in 11.x-dev.

  • Status changed to Needs review 10 months ago
  • 🇮🇳India shalini_jha

    Hi everyone,
    I have taken reference from #9 and added all the required changes and added a Mr with test .
    added screen shot for your reference.
    please review.

  • Pipeline finished with Failed
    10 months ago
    #81851
  • Assigned to dishakatariya
  • Pipeline finished with Success
    10 months ago
    #81881
  • Issue was unassigned.
  • Status changed to RTBC 10 months ago
  • 🇮🇳India dishakatariya

    Hi, I have verified and tested MR- merge_requests/6306 file on the 11.x version with.It is working as expected now.
    Testing steps-
    Install the Drupal 11.x version
    Now go to the /structure/taxonomy and click on list terms
    Now click to Add term
    Add themultiple terms, set as one parent term and in that drag the other as child terms
    Now click to save
    and then click to the Delete operation
    and now see on the popup which displays the parent term name with the child name as well with the notification.
    Testing Result:
    Orphan taxonomy terms are deleted with the notification.
    Attaching screenshot for reference.
    Thanks!

  • Pipeline finished with Running
    10 months ago
    #82190
  • Status changed to Needs work 10 months ago
  • 🇳🇿New Zealand quietone

    Oh, I do love older issues getting fixed. Thanks!

    I'm triaging RTBC issues .

    I checked the history and the issue summary was last updated in 2016, so I suspect it is out of date. Yes, it is it states that tests are needed but I some in the MR. It is a well written issue summary though. Easy to know what is being fixed here. I am tagging for an Issue Summary update. This is changing the UI so I am tagging for Usability. Since it does change the UI before and after screenshots should be available to the reviewer from the Issue Summary. I have updated the issue summary to the current standard template to help with the update.

    I then read the comments. #9 states "I'm not satisfied with the complicated solution I ended up to nicely display a list of entity labels". That patch was converted to an MR and that code looks to be the same. That still needs to be addressed. And further, I do not a comment that anyone has done a code review.

    There is a contributor task for https://www.drupal.org/community/contributor-guide/task/review-a-patch-or-merge-request that you may find helpful.

    I have not reviewed the MR nor tested it.

Production build 0.71.5 2024