How to remove a deleted term entity from Entity Reference field after deleting the term entity.

Mykola Veryha
1 min readNov 27, 2019

--

For checking which nodes are using the taxonomy term I will use the taxonomy_index table. It makes sense because we know that the table is updating after each updating a node. So in this table, we have relevant data.

For make sure in that you can check these two hooks in taxonomy.module

So let’s get the node ids that are using the term entity and remove the term references from their fields. Please replace dh_extranet on your MODULE_NAME.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response