Assign parent term to term
AlexisWilke - June 13, 2009 - 20:16
| Project: | Rules |
| Version: | 6.x-1.x-dev |
| Component: | Provided module integration |
| Category: | task |
| Priority: | normal |
| Assigned: | AlexisWilke |
| Status: | needs work |
Description
Hi guys,
This function will assign a term as the parent of another term. You first need to load the two term or add a term and load another. Name one term Child and the other Parent, then use this taxonomy patch to assign one term as the parent of the other.
Thank you.
Alexis Wilke
| Attachment | Size |
|---|---|
| rules-6.x-parent_term.patch | 1.58 KB |

#1
We actually need to delete the hierarchy entry with the given TID and Parent = 0.
New patch attached.
Thank you.
Alexis
#2
Hm, I don't like fiddling around in foreign database tables. This should be done by API if possible. --> http://api.drupal.org/api/function/taxonomy_save_term/6
Ideally we should make the taxonomy_term data object savable, as noted in #456328: Taxonomy actions: Add/Delete term