Thank you, this module is very useful. I have discovered a lot of orphaned terms in my term_hierarchy table which do not have any entry in the term_data.
Could these have been orphaned by this module? Or could this module help to clean them up?
Simon

Comments

jmroth’s picture

Category: feature » support
Status: Active » Closed (fixed)

No this module does not make anything an orphan but removes terms that are already orphaned.

jmroth’s picture

Oh there's one more thing: term_hierarchy shows the hierarchy (that is, as it says, the tree of terms). If one of those does not appear in term_data does not mean that all of its *children* are orphaned. If you delete the parent, it will delete all children, but I guess that is not what you want to do. And this module doesn't do that either.

jmroth’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Assigned: Unassigned » jmroth
Category: support » feature
Status: Closed (fixed) » Needs work

I am starting to get your point after my 3rd coffee. You mean we should do an additional sweep to find out if some more items have become orphaned because their children were all deleted. That sounds understandable.

jmroth’s picture

Status: Needs work » Closed (won't fix)

I have thought about this again. I don't think what you said above can happen.

If you have tids in your {term_hierarchy} table that do not exist in {term_data} then we did not do that because we only use taxonomy_del_term() which cleans all those tables when a term is deleted.

Also, there is no need to do additional sweeps as I believed, since taxonomy_term_count_nodes() counts all nodes down to the leaf of the taxonomy tree starting from that parent, for each term. Therefore, we can remove all orphaned terms in one step.

Please feel free to post back if you still believe there is a problem here. Please give as many details as possible then.