Add a checking for the same term replacement

Created on 13 May 2024, 5 months ago
Updated 29 May 2024, 4 months ago

Problem/Motivation

When replacing any term's nodes with the same term, it does allow the user to "replace" nodes from a term to the same term and then deletes the term as expected.

Steps to reproduce

  1. Create a Vocabulary with some terms in it.
  2. Create a *required Entity Reference - Taxonomy Term field which targets Vocabulary
  3. Use Devel Generate to create dummy content for the content type having the newly created field.
  4. Go to 's term page - /taxonomy/term/{id}/replace?destination=/admin/structure/taxonomy/manage/<vocabulary>/overview
  5. Make sure that there are some nodes associated with the term ID.
  6. In the field - "Taxonomy term to use instead", enter the name of the term ID you are replacing from, i.e. -
    • Current taxonomy term - 'ABCD'
    • Taxonomy term to use instead - 'ABCD'
  7. The process will be completed successfully, and the nodes will be "replaced" with the same term, and the term will be deleted, as is the functionality of this module.

Proposed resolution

Add a checking before replacing terms - Check to see whether the current and replacement terms are different or not.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India ishanghosh27

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024