--- C:/Users/ANDREY~1.ZAK/AppData/Local/Temp/taxonomy.i-revBASE.svn002.tmp.inc	Wed Sep  7 15:11:09 2011
+++ D:/src/drupal/sites/all/modules/drupal-contrib/feeds/mappers/taxonomy.inc	Wed Sep  7 15:10:29 2011
@@ -153,20 +153,23 @@
  *   An object of type stdClass that represents a vocabulary.
  */
 function taxonomy_get_vocabulary($id) {
-  static $vocabularies;
-  if (!isset($vocabularies[$id])) {
-    foreach (taxonomy_get_vocabularies() as $vocabulary) {
-      if ($vocabulary->vid == $id) {
-        $vocabularies[$id] = $vocabulary;
-        break;
+   static $vocabularies;
+   if (!isset($vocabularies[$id])) {
+      foreach (taxonomy_get_vocabularies() as $vocabulary) {
+         if ($vocabulary->machine_name == $id) {
+            $vocabularies[$id] = $vocabulary;
+            break;
+         }
+         if ($vocabulary->vid == $id) {
+            $vocabularies[$id] = $vocabulary;
+            break;
+         } elseif ($vocabulary->module == $id) {
+            $vocabularies[$id] = $vocabulary;
+            break;
+         }
       }
-      elseif ($vocabulary->module == $id) {
-        $vocabularies[$id] = $vocabulary;
-        break;
-      }
-    }
-  }
-  return $vocabularies[$id];
+   }
+   return $vocabularies[$id];
 }
 
 /**
@@ -177,8 +180,11 @@
  *   vocabulary's vid otherwise.
  */
 function taxonomy_vocabulary_id($vocabulary) {
-  if (strpos($vocabulary->module, 'features_') === 0) {
-    return $vocabulary->module;
-  }
-  return $vocabulary->vid;
+   if (!empty($vocabulary->machine_name)) {
+      return $vocabulary->machine_name;
+   }
+   if (strpos($vocabulary->module, 'features_') === 0) {
+      return $vocabulary->module;
+   }
+   return $vocabulary->vid;
 }
