Index: mappers/taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/mappers/taxonomy.inc,v
retrieving revision 1.1
diff -u -p -r1.1 taxonomy.inc
--- mappers/taxonomy.inc	5 Dec 2009 01:38:27 -0000	1.1
+++ mappers/taxonomy.inc	15 Feb 2010 00:00:14 -0000
@@ -62,19 +62,34 @@ function taxonomy_feeds_set_target(&$nod
   else {
     foreach ($terms as $term_name) {
       // Check if a term already exists.
-      if ($terms_found = taxonomy_get_term_by_name_vid($term_name, $vocab->vid)) {
-        // If any terms are found add them to the node's taxonomy by found tid.
-        foreach ($terms_found AS $term_found) {
-          $node->taxonomy[$vocab->vid][$term_found->tid] = $term_found->tid;
-          if (!$vocab->multiple) {
-            break;
-          }
+      $terms_found = taxonomy_get_term_by_name_vid($term_name, $vocab->vid);
+      // If not, create a new term.
+      if (empty($terms_found)) {
+        $new_term = array(
+          'name' => $term_name,
+          'vid' => $vocab->vid,
+        );
+        $status = taxonomy_save_term($new_term);
+        // Check to see if everything went right.
+        if ($status == SAVED_NEW) {
+          $new_term['tid'] = db_last_insert_id('term_data', 'tid');
+          $terms_found = array((object) $new_term);
         }
-        // If the vocab is not for multiple tags break after the first hit.
+        // Break if we have no term to map.
+        else {
+          break;
+        }
+      }
+      // If any terms are found add them to the node's taxonomy by found tid.
+      foreach ($terms_found AS $term_found) {
+        $node->taxonomy[$vocab->vid][$term_found->tid] = $term_found->tid;
         if (!$vocab->multiple) {
           break;
         }
-
+      }
+      // If the vocab is not for multiple tags break after the first hit.
+      if (!$vocab->multiple) {
+        break;
       }
     }
   }
