Index: linkit_taxonomy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/linkit/plugins/linkit_taxonomy/linkit_taxonomy.module,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 linkit_taxonomy.module
--- linkit_taxonomy.module	24 Nov 2010 22:20:47 -0000	1.7.2.2
+++ linkit_taxonomy.module	4 Jan 2011 21:48:17 -0000
@@ -18,7 +18,7 @@
   // Prevent "PHP notice: Undefined variable"
   _linkit_taxonomy_get_default_settings($settings);
 
-  $fields = array('t.name', 't.tid '); // default fields
+  $fields = array('t.name', 't.tid', 't.vid', 't.description', 't.weight'); // default fields
   $from = array('{term_data} t'); // default from
   $where = array(); // default where
 
@@ -34,7 +34,7 @@
   while ($term = db_fetch_object($result)) {
     $matches['taxonomy'][$i] = array(
       'title' => $term->name,
-      'path' => 'internal:taxonomy/term/' . $term->tid,
+      'path' => 'internal:' . taxonomy_term_path($term),
       'information' => array(
         'type' => 'Taxonomy',
       ),
@@ -69,20 +69,24 @@
 
   // Check to see that the link really is a term link
   $splitted_string = explode('/', str_replace('internal:', '', $string));
-  if ($splitted_string[0] != 'taxonomy') {
-    return;
+  if (!is_numeric($splitted_string[count($splitted_string)-1])) {
+    return ;
   }
-
-  // This is a term link created with Linkit, try to grab the title and path now. 
-  $result = db_query(db_rewrite_sql("SELECT td.tid, td.name FROM {term_data} td WHERE td.tid = %d"), $splitted_string[2]);
-  $term = db_fetch_object($result);
-
-  // No reault or no term was found
-  if (!$result || !$term) {
-    return;
+  
+  // Try to get a term object
+  $term = taxonomy_get_term($splitted_string[count($splitted_string)-1]);
+  // taxonomy_get_term is returns an object
+  if (!is_object($term)) {
+    return ;
   }
-
-  return check_plain($term->name) . ' [path:internal:taxonomy/term/' . $term->tid . ']';
+  
+  // Ok, this looks like a term, get the path
+  $path = taxonomy_term_path($term);
+  
+  // If $path is the same as the provided $string, we have a match.
+  if ($path == str_replace('internal:', '', $string)) {
+    return check_plain($term->name) . ' [path:internal:' . taxonomy_term_path($term) . ']';
+  }  
 }
 
 /**

