Index: wrappers/taxonomy.module.copyme =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/category/wrappers/taxonomy.module.copyme,v retrieving revision 1.26.2.2 diff -u -p -r1.26.2.2 taxonomy.module.copyme --- wrappers/taxonomy.module.copyme 2 Feb 2007 08:24:56 -0000 1.26.2.2 +++ wrappers/taxonomy.module.copyme 7 Feb 2007 17:46:34 -0000 @@ -559,20 +559,24 @@ function taxonomy_node_save($nid, $terms } } if (is_array($terms)) { + $saved_terms = array(); foreach ($terms as $key => $term) { if ($key != 'tags' && $key != 'legacy') { if (is_array($term)) { foreach ($term as $tid) { - if (!empty($tid)) { + if (!empty($tid) && !isset($saved_terms[$tid])) { db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $tid); + $saved_terms[$tid] = TRUE; } } } - else if (isset($term->tid)) { + else if (isset($term->tid) && !isset($saved_terms[$term->tid])) { db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $term->tid); + $saved_terms[$term->tid] = TRUE; } - else if ($term) { + else if (is_numeric($term) && !isset($saved_terms[$term])) { db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $term); + $saved_terms[$term] = TRUE; } } }