Posted by ebhakt on March 24, 2010 at 3:58pm
hi
i am using the services 2.x module and i am at the point where i need to get the vocab tree for a selected vid
what i noticed is that the return value for taxonomy.getTree doesnot containg the name of the vocabulary
it do contain the tid and taxonomy names and the respective vid's but nowhere there is a mention of vocabulary name
Isn't that a bug that should be taken care of ??
Comments
Taxonomy get tree
Tables used by taxonomy module are:
term_data
term_hierarchy
term_node
term_relation
term_synonym
vocabulary
vocabulary_node_types
taxonomy_get_tree function return data from term_data and term_hierarchy tables. Inorder to include the vocablulary name in the return object, vocabulary table should also be joined to the above 2 tables. The mandatory paramenter vid to the taxonomy_get_tree() can be obtained by
If you use option 1, then you are aware of the vocabulary name before executing the function.
Refer taxonomy_get_tree
Taxonomy Related function list
All taxonomy get tree, willalways be tids. there has to another query to the bbb table to get the vocubulary name.
In case of repeady used taxonomy ids it is good practice to cache information appropriately since teh above queries could be expensive in larger database.