Index: core/taxonomy.inc =================================================================== --- core/taxonomy.inc 29 May 2009 23:06:32 -0000 1.1.2.8.2.2 +++ core/taxonomy.inc 29 May 2009 23:12:20 -0000 @@ -17,10 +17,18 @@ * * @param $name * A term name to search on. + * @param $vid + * A vocabulary to limit the search to. */ -function install_taxonomy_get_tid($name) { - // Not guaranteed to be unique, hence the range limit. - return db_result(db_query_range("SELECT tid FROM {term_data} WHERE name = '%s'", $name, 0, 1)); +function install_taxonomy_get_tid($name, $vid = 0) { + // if a vid is passed in, limit to it + if ($vid) { + $results = db_query_range("SELECT tid FROM {term_data} WHERE name = '%s' and vid = %d", $name, $vid, 0, 1); + } + else { + $results = db_query_range("SELECT tid FROM {term_data} WHERE name = '%s'", $name, 0, 1); + } + return db_result($results); }; /**