Index: menutrails.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/menutrails/menutrails.module,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 menutrails.module
--- menutrails.module	27 Jun 2007 23:09:56 -0000	1.2.2.1
+++ menutrails.module	11 Aug 2008 16:05:01 -0000
@@ -51,9 +51,11 @@ function menutrails_node_location($node)
     $type_trails = variable_get('menutrails_node_types', array());
     $mid = $type_trails[$node->type];
     $term_trails = variable_get('menutrails_terms', array());
-    foreach($node->taxonomy as $tid => $term) {
-      if ($term_trails[$tid] > 0) {
-        $mid = $term_trails[$tid];
+    if (isset($node->taxonomy)) {
+      foreach($node->taxonomy as $tid => $term) {
+        if ($term_trails[$tid] > 0) {
+          $mid = $term_trails[$tid];
+        }
       }
     }
     if ($mid > 0) {
@@ -95,7 +97,9 @@ function menutrails_settings_form() {
   $options = $options + menu_parent_options($item['mid'], variable_get('menu_parent_items', 0)); 
   $node_types = node_get_types('names');
   $node_trails = variable_get('menutrails_node_types', array());
-  $vocabs = taxonomy_get_vocabularies();
+  if (module_exists('taxonomy')) {
+    $vocabs = taxonomy_get_vocabularies();
+  }
   $term_trails = variable_get('menutrails_terms', array());
   $form['description'] = array(
     '#tyoe' => 'markup',
@@ -121,24 +125,26 @@ function menutrails_settings_form() {
       '#options' => $options,
     );
   }
-  foreach ($vocabs as $vocab) {
-    $form[$vocab->vid]['menutrails_terms'] = array(
-      '#tree' => TRUE,
-      '#type' => 'fieldset',
-      '#collapsible' => TRUE,
-      '#collapsed' => TRUE,
-      '#title' => t('Menu trails by category:'). " $vocab->name",
-    );
-    $terms = taxonomy_get_tree($vocab->vid);
-    foreach ($terms as $term) {
-       $form[$vocab->vid]['menutrails_terms'][$term->tid] = array('#type' => 'select',
-        '#title' => t('Parent item for'). " $term->name",
-        '#default_value' => $term_trails[$term->tid],
-        '#options' => $options,
+  if (isset($vocabs)) {
+    foreach ($vocabs as $vocab) {
+      $form[$vocab->vid]['menutrails_terms'] = array(
+        '#tree' => TRUE,
+        '#type' => 'fieldset',
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
+        '#title' => t('Menu trails by category:'). " $vocab->name",
       );
+      $terms = taxonomy_get_tree($vocab->vid);
+      foreach ($terms as $term) {
+         $form[$vocab->vid]['menutrails_terms'][$term->tid] = array('#type' => 'select',
+          '#title' => t('Parent item for'). " $term->name",
+          '#default_value' => $term_trails[$term->tid],
+          '#options' => $options,
+        );
+      }
     }
   }
-  
+
   return system_settings_form($form);
 }
 
