Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296046

Content remains tagged with a taxonomy term (via the {taxonomy_index} table) even after its corresponding term reference field is deleted and purged

$
0
0

Problem/Motivation

Deletion of a taxonomy field from a content type leaves references to affected nodes in taxonomy_index, which results in vocabulary terms remaining attached to those nodes.

Steps to replicate:

  1. Go to admin/structure/taxonomy/tags and add a new term.
  2. Go to admin/structure/types and add a new content type.
  3. On the “Manage fields” tab for the new content type, add a new term reference field using the select widget. Save and select the “tags” vocabulary on the field settings form.
  4. Go to node/add and add a node of the content type created in Step #2. Select the term you added in Step #1 in the field from Step #3 and save.
  5. Go to admin/structure/types and click on the "Manage fields" tab.
  6. Delete the term reference field created in Step #3.
  7. Go to admin/structure/taxonomy/tags and click on the tag created in Step #1.
  8. Observe that the node from Step #4 is still listed, despite that the field containing this term was removed from the content type.

Expected behaviour
You are given the message "If you have any content left in this field, it will be lost. This action cannot be undone." indicating that any tags given to content of this content type will be removed.

Actual behaviour
Content remains tagged with the vocabulary despite not having the field any more. These can be removed by readding the term reference field, removing the tags for the content and then removing the field again.

Proposed resolution

Deleting references by vocabulary is complicated by the potential for data loss if two taxonomy fields on a content type reference the same vocabulary. Proposed resolution is to clear and rebuild taxonomy_index. This may cause slowdown on large sites; suggested that it should run through Queue API.

Remaining tasks

This issue is currently waiting on a patch in #89181: Use queue API for node and comment, user, node multiple deletes.

User interface changes

Warning message noting the potential delay in taxonomy re-indexing and a link to cron for immediate rebuild if desired.


Viewing all articles
Browse latest Browse all 296046


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>