Duplicate Terms Created on Import – No Check for Existing Terms

Created on 1 February 2025, 28 days ago

Description:

When importing taxonomy terms using Taxonomy Manager 2.0.16, the module does not check whether a term already exists before adding it again.

Steps to Reproduce:

Import the following structure:

TermA
├── child1
├── child2
├── child3

The import works correctly, creating TermA and its child terms.
Import the same structure again on the next day.
Result: TermA (along with child1, child2, child3) is duplicated in the taxonomy vocabulary.

Expected Behavior:

The module should check if a term with the same name already exists in the vocabulary before adding it again.
If the term exists, it should either be skipped or updated rather than duplicated.
This is standard behavior in other parts of Drupal, such as when adding tags via a reference field – existing terms are not duplicated.

Additional Notes:

The issue also occurs when manually adding terms through the UI.
I am using Drupal 11.

Could this functionality be improved to prevent duplicate terms during import?
Thanks!

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇦🇹Austria gr4phic3r

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gr4phic3r
  • 🇮🇳India lavanyatalwar

    Hi @mp,
    Could you please confirm if I’m understanding this correctly?
    When going to Structure > Taxonomy Manager and adding a new term from there, is there a chance that terms could be duplicated?

  • 🇦🇹Austria gr4phic3r

    hi @lavanyatalwar

    yes, correct. If there exists a term for example "Drupal" in the vocabulary "CMS" and you click on the ADD Button and add "Drupal" again then it is 2 times in this vocabulary

Production build 0.71.5 2024