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

AttachmentSize
rules-6.x-parent_term.patch1.58 KB

#1

AlexisWilke - June 14, 2009 - 06:31

We actually need to delete the hierarchy entry with the given TID and Parent = 0.

New patch attached.

Thank you.
Alexis

AttachmentSize
rules-6.x-parent_term.patch 1.69 KB

#2

fago - June 26, 2009 - 12:24
Category:feature request» task
Status:needs review» needs work

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

 
 

Drupal is a registered trademark of Dries Buytaert.