If a node has access to multiple taxonomy vocabularies, autocategorise removes taxonomy settings for vocabs that are NOT set to be used with autocategorise.

For example, a node on my site can be tagged under "Business Area" as well as "File Type". So a node on my site can be tagged as "Manufacturing" under the Business Area vocab as well as "Video" under the File Type vocab. File Type is the vocab that I have set to use autocategorise.

However, autocategorise resets my Business Area vocab to null no matter what I select within it.

Comments

HonorsGrad’s picture

To make sure the module only deletes terms from its own vocab, I altered the code as follows:

**From**

  if (empty($matches)){
    $matches[]=$catch_all_tid;
   // $misc=$node->nid;
  }
  //need to remove all the terms from this vocabulary for this node and resave them
  db_query('DELETE FROM {term_node} WHERE nid = %d', $node->nid);
  taxonomy_node_save($node, $matches);
}

**To**

  if (empty($matches)){
   $matches[]=$catch_all_tid;
   // $misc=$node->nid;
  }
  $where = '';
	foreach ($terms as $tid=>$term){
		foreach ($term as $synonym){
			$where = $where .','. $tid;
		}
	}
  //need to remove all the terms from this vocabulary for this node and resave them
  db_query('DELETE FROM {term_node} WHERE nid = %d and tid in (0, %d)', $node->nid, $where);
  taxonomy_node_save($node, $matches);
}

I'm sure it isn't the cleanest, but it seems to work.

matslats’s picture

All sorted in version 1.3

matslats’s picture

Status: Active » Closed (fixed)