Index: taxonomy.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/diff/Attic/taxonomy.inc,v
retrieving revision 1.3
diff -u -F^f -r1.3 taxonomy.inc
--- taxonomy.inc	5 Mar 2008 21:03:17 -0000	1.3
+++ taxonomy.inc	21 Mar 2008 21:45:03 -0000
@@ -11,7 +11,7 @@ function taxonomy_diff(&$old_node, &$new
   $new_taxonomy = array();
   if($old_node->taxonomy) {
     foreach($old_node->taxonomy as $term) {
-      $old_taxonomy[] = $term->name;
+      $old_taxonomy[$term->tid] = $term->name;
     }
   }
   if ($new_node->taxonomy) {
@@ -22,7 +22,7 @@ function taxonomy_diff(&$old_node, &$new
         if (is_numeric($id)) {
           foreach($entry as $tid) {
             $term = taxonomy_get_term($tid);
-            $new_taxonomy[] = $term->name;
+            $new_taxonomy[$term->tid] = $term->name;
           }
         }
         else {
@@ -30,17 +30,19 @@ function taxonomy_diff(&$old_node, &$new
           // vocabularies. These are stored as an array which map the vocabulary id to
           // a string of terms.
           foreach($entry as $taglist) {
+            drupal_set_message(print_r($entry, true));
             // The regular expression is taken from taxonomy.module.
             preg_match_all('%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x', $taglist, $matches);
-            foreach($matches[1] as $term) {
-              $new_taxonomy[] = $term;
+            foreach($matches[1] as $name) {
+              $term = taxonomy_get_term_by_name($name);
+              $new_taxonomy[$term->tid] = $term->name;
             }
           }
         }
       }
       else {
         // Not during editing the taxonomy list is a list of terms.
-        $new_taxonomy[] = $entry->name;
+        $new_taxonomy[$entry->tid] = $entry->name;
       }
     }
   }
