summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Taranyuk2011-05-11 02:20:41 (GMT)
committer Artem Taranyuk2011-05-11 02:20:41 (GMT)
commit1c7d9dbd32c3331e0205295a292a6c53938ceed7 (patch)
tree71ef0aa51f5c886f04e9f2d8b7add22212076501
parentc89d964728bf4185402e99b66a9466975dcb6673 (diff)
Fixed issue: remove old associations on node update
-rw-r--r--content_taxonomy.module5
1 files changed, 5 insertions, 0 deletions
diff --git a/content_taxonomy.module b/content_taxonomy.module
index 30a1e38..08982d5 100644
--- a/content_taxonomy.module
+++ b/content_taxonomy.module
@@ -187,6 +187,11 @@ function content_taxonomy_field($op, &$node, $field, &$items, $teaser, $page) {
if (empty($node->taxonomy)) {
$node->taxonomy[$field['vid']] = NULL;
}
+
+ if ($node->nid) {
+ // Remove old associations of a node to its terms
+ db_query('DELETE FROM {term_node} WHERE nid = %d', $node->nid);
+ }
}
break;
}