diff -up yahoo_terms-default/yahoo_terms.info yahoo_terms/yahoo_terms.info
--- yahoo_terms-default/yahoo_terms.info	2007-09-05 17:09:25.000000000 -0700
+++ yahoo_terms/yahoo_terms.info	2008-04-20 06:38:45.000000000 -0700
@@ -1,9 +1,4 @@
 ; $Id: yahoo_terms.info,v 1.1.4.3 2007/06/18 23:07:17 dww Exp $
 name = "Yahoo Terms Extractor"
 description = "Extract terms from English language texts and nodes and save into the taxonomy hierarchy"
-
-; Information added by drupal.org packaging script on 2007-09-06
-version = "5.x-1.x-dev"
-project = "yahoo_terms"
-datestamp = "1189037365"
-
+core = 6.x
\ No newline at end of file
diff -up yahoo_terms-default/yahoo_terms.module yahoo_terms/yahoo_terms.module
--- yahoo_terms-default/yahoo_terms.module	2007-09-05 12:04:26.000000000 -0700
+++ yahoo_terms/yahoo_terms.module	2008-04-21 05:49:03.000000000 -0700
@@ -1,4 +1,5 @@
 <?php
+// $Id$
 /**
  * @file
  * Provides an interface to other modules to use Yahoo Term Extractor service
@@ -7,7 +8,7 @@
  *
  * @author
  * Aron Novak <aron at novaak dot net>
- * 
+ *
  */
 
 /**
@@ -74,14 +75,15 @@ function yahoo_terms_text_get_keywords($
   }
   if ($limit != -1) {
     $result = array_slice($result['ResultSet']['Result'], 0, $limit);
-  } else {
+  }
+  else {
     $result = $result['ResultSet']['Result'];
   }
   $result = array_unique($result);
   // Drop the blacklist items
   if (count($blacklist) > 0) {
-    foreach($result as $id => $term) {
-      if(in_array($term, $blacklist)) {
+    foreach ( $result as $id => $term ) {
+      if (in_array( $term, $blacklist )) {
         unset($result[$id]);
       }
     }
@@ -99,7 +101,7 @@ function _yahoo_terms_which_vocab($type)
 }
 
 /**
- * Parse the given node's body and assign 
+ * Parse the given node's body and assign
  *
  * @param object $node
  * The node to be parsed
@@ -116,11 +118,18 @@ function yahoo_terms_node_assign_keyword
   $limit = ($limit === FALSE) ? variable_get('yahoo_terms_taxonomy_limit', -1) : $limit;
   $terms = yahoo_terms_text_get_keywords($text, $query, $limit, $blacklist);
   $tids = _yahoo_terms_create_vocabulary_items($terms, $vid, $static);
-  $tids_in_node = array_keys($node->taxonomy);
   $tids_fetched = array_keys($tids);
-  // Union of these arrays
-  $tids_now = $tids_in_node + $tids_fetched;
-  taxonomy_node_save($node->nid, $tids_now);
+  if ($node->taxonomy) {
+    $tids_in_node = array_keys($node->taxonomy);
+    // Union of these arrays
+    $tids_now = $tids_in_node + $tids_fetched;
+  }
+  else {
+    // Union of these arrays
+    $tids_now = $tids_fetched;
+  }
+  taxonomy_node_save($node, $tids_now);
+  
 }
 
 /**
@@ -227,34 +236,46 @@ function yahoo_terms_perm() {
 /**
  * Implements hook_link()
  */
-function yahoo_terms_link($type, $node = NULL, $teaser = FALSE) {
-  $vid = _yahoo_terms_which_vocab($node->type);
-  $count = db_num_rows(db_query("SELECT vid FROM {vocabulary_node_types} WHERE vid = %d AND type = '%s'", $vid, $node->type));
-  if ($count != 0) {
-    if ($type == 'node' && $node != NULL) {
-      if (user_access(YAHOO_TERMS_USE) && user_access("administer nodes") && variable_get('yahoo_terms_enable_link', FALSE)) {
-        $links["yahoo_terms_extract"] = array('title' => t('Extract terms'), 'href' => 'yahoo_terms/'. $node->nid);
-      }
-    }
-  }
-  return $links;
-}
+// function yahoo_terms_link($type, $node = NULL, $teaser = FALSE) {
+//   $vid = _yahoo_terms_which_vocab($node->type);
+//   // $count = 1;
+//   $count = db_result(db_query("SELECT COUNT(vid) FROM {vocabulary_node_types} WHERE vid = %d AND type = '%s')", $vid, $node->type));
+//   if ($count != 0) {
+//     if ($type == 'node' && $node != NULL) {
+//       if (user_access(YAHOO_TERMS_USE) && user_access("administer nodes") && variable_get('yahoo_terms_enable_link', FALSE)) {
+//         $links["yahoo_terms_extract"] = array('title' => t('Extract terms'), 'href' => 'yahoo_terms/'. $node->nid);
+//       }
+//     }
+//   }
+//   return $links;
+// }
 
 /**
  * Implements hook_menu()
  */
-function yahoo_terms_menu($may_cache) {
+function yahoo_terms_menu() {
   
   $items = array();
-  if ($may_cache) {
-    $items[] = array('path' => 'yahoo_terms', 'title' => t('Extraction...'),
-        'callback' => '_yahoo_terms_process_node', 'access' => user_access(YAHOO_TERMS_USE),
-        'type' => MENU_CALLBACK);
-    $items[] = array('path' => 'admin/settings/yahoo_terms', 'title' => t('Yahoo Terms'),
-        'callback' => 'drupal_get_form', 'callback arguments' => array('yahoo_terms_admin_settings'));
-    $items[] = array('path' => 'yahoo_terms/batch', 'title' => t('Yahoo Terms batch processing'),
-        'callback' => 'yahoo_terms_batch_page', 'access' => user_access(YAHOO_TERMS_USE) && user_access('administer nodes'));
-  }
+  $items['yahoo_terms'] = array(
+    'title' => t('Extraction...'),
+    'page callback' => '_yahoo_terms_process_node',
+    'access callback' => 'user_access',
+    'access arguments' => array('YAHOO_TERMS_USE'),
+    'type' => MENU_CALLBACK
+    );
+  $items['admin/settings/yahoo_terms'] = array(
+    'title' => t('Yahoo Terms'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('yahoo_terms_admin_settings'),
+    'access callback' => 'user_access',
+    'access arguments' => array('YAHOO_TERMS_USE')
+    );
+  $items['yahoo_terms/batch'] = array(
+    'title' => t('Yahoo Terms batch processing'),
+    'page callback' => 'yahoo_terms_batch_page',
+    'access callback' =>  'user_access',
+    'access arguments' => array('YAHOO_TERMS_USE') // TODO: The D5 version had 'administer nodes' as a permission.
+    );
   return $items;
 }
 
@@ -317,7 +338,7 @@ function yahoo_terms_nodeapi(&$node, $op
   }
 }
 
-function yahoo_terms_form_alter($form_id, &$form) {
+function yahoo_terms_form_alter(&$form, &$form_state, $form_id) {
   if (isset($form['#node_type']) && 'node_type_form' == $form_id) {
     $node_type = $form['old_type']['#value'];
     $select_voc = _yahoo_terms_vocab_select($node_type);
@@ -352,7 +373,7 @@ function yahoo_terms_form_alter($form_id
       '#return_value' => TRUE,
       '#required' => FALSE,
       '#default_value' => variable_get('yahoo_terms_process_existing_'. $node_type, FALSE),
-    ); 
+    );
   }
 }
 
@@ -401,37 +422,39 @@ function yahoo_terms_batch() {
     '#type' => 'submit',
     '#value' => 'Start tagging'
   );
+  $form['#submit'] = array('yahoo_terms_batch_submit_handler');
   return $form;
 }
 
 /**
  * Batch tagging a specific content type
  */
-function yahoo_terms_batch_submit($form_id, $form_values) {
+function yahoo_terms_batch_submit_handler($form, &$form_state) {
   timer_start("yahoo_terms_batch");
   $num_of_processed = 0;
-  $limit_number = $form_values['limit_number'];
+  $limit_number = $form_state['values']['limit_number'];
+  // dprint_r($form_state);
   if ($limit_number == 0) {
-    $result = db_query("SELECT nid FROM {node} WHERE type = '%s'", 
-                       $form_values['type']);
+    $result = db_query("SELECT nid FROM {node} WHERE type = '%s'",
+    $form_state['values']['type']);
   }
   else {
-    if (!$form_values['rewrite']) {
+    if (!$form_state['values']['rewrite']) {
       $result = db_query("SELECT n.nid FROM {node} n LEFT JOIN {term_node} t ON t.nid=n.nid WHERE t.nid IS NULL and type = '%s' ORDER BY created DESC LIMIT %d",
-                          $form_values['type'], $form_values['limit_number']
+      $form_state['values']['type'], $form_state['values']['limit_number']
       );
     }
     else {
       $result = db_query("SELECT nid FROM {node}
                           WHERE type = '%s' LIMIT %d",
-                          $form_values['type'], $form_values['limit_number']
+                          $form_state['values']['type'], $form_state['values']['limit_number']
       );
     }
   }
   while ($node = db_fetch_array($result)) {
     $node = node_load($node['nid']);
-    if ( (!isset($node->taxonomy) || count($node->taxonomy) == 0) || $form_values['rewrite']) {
-      yahoo_terms_node_assign_keywords($node, "", array(), $form_values['vid']);
+    if ( (!isset($node->taxonomy) || count($node->taxonomy) == 0) || $form_state['values']['rewrite']) {
+      yahoo_terms_node_assign_keywords($node, "", array(), $form_state['values']['vid']);
       $num_of_processed++;
     }
   }
@@ -460,7 +483,7 @@ function _yahoo_terms_vocab_select($type
     $select_voc[$voc['vid']] = $voc['name'];
   }
   if (count($select_voc) < 1) {
-    $select_voc[0] = 'No vocabularies found'; 
+    $select_voc[0] = 'No vocabularies found';
   }
   return $select_voc;
 }
@@ -471,7 +494,7 @@ function _yahoo_terms_vocab_select($type
  */
 function yahoo_terms_cron() {
   $types = node_get_types();
-  foreach($types as $type => $type_object) {
+  foreach ($types as $type => $type_object) {
     if (variable_get('yahoo_terms_process_existing_'. $type, FALSE) == TRUE) {
       variable_set('yahoo_terms_process_existing_'. $type, FALSE);
       $result = db_query("SELECT nid FROM {node} WHERE type = '%s'", $type);
