Index: content_taxonomy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/content_taxonomy/content_taxonomy.module,v
retrieving revision 1.2.2.16
diff -u -p -r1.2.2.16 content_taxonomy.module
--- content_taxonomy.module     18 May 2008 20:30:36 -0000      1.2.2.16
+++ content_taxonomy.module     25 Jul 2008 22:43:42 -0000
@@ -218,9 +218,10 @@ function content_taxonomy_field_formatte
  */
 function content_taxonomy_terms_by_field($node, $vid, $parent = NULL, $depth) {
   if (is_numeric($parent) && $depth == 1) {
-    $result = db_query("SELECT n.tid FROM {term_hierarchy} h, {term_node} n WHERE
-      n.nid = %d AND n.tid = h.tid AND h.parent = %d", $node->nid, $parent);
-
+   $result = db_query("SELECT n.tid FROM {term_hierarchy} h, {term_node} n, {term_data} td WHERE
+      n.nid = %d AND n.tid = h.tid AND h.parent = %d AND td.tid=n.tid AND td.vid=%d",
+      $node->nid, $parent, $vid);
+
     while ($data = db_fetch_array($result)) {
       $term = taxonomy_get_term($data["tid"]);
       $additions[$term->tid] = $term;
