I have several fields in the node that are type "content_taxonomy", and when these fields are told to get their terms from a freetagging vocabulary, every field in this case shows the same terms--but none are from that vocabulary, but from other vocabularies--even if they were not freetagging themselves).

This is because one of the queries does not limit by vocabulary ID. Attached is a patch.

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;
CommentFileSizeAuthor
content_taxonomy_fretagging.patch1.11 KBjanusman

Comments

Vuds’s picture

Status: Needs review » Reviewed & tested by the community

I applied that patch and it worked to solve the issue (mine's is little different of janusman, I'm not using freetaging, but I have 4 activeselect fields in one form and it was messing up all of them when showing the results). This should be applied to the core.

janusman’s picture

Bump! Really need this. I can issue a newer patch if it helps...

magnus’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Cleanup of old issues. According to maintainer: "active development is only done for the 6.x branch! 5.x is not supported any more".
Open a new issue if problem still exist.