Index: pathauto/pathauto_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto_taxonomy.inc,v
retrieving revision 1.20.4.18
diff -u -r1.20.4.18 pathauto_taxonomy.inc
--- pathauto/pathauto_taxonomy.inc	25 Nov 2007 15:57:41 -0000	1.20.4.18
+++ pathauto/pathauto_taxonomy.inc	29 Nov 2007 22:09:03 -0000
@@ -28,13 +28,10 @@
       $vocabularies = taxonomy_get_vocabularies();
       if (sizeof($vocabularies) > 0) {
         $settings['patternitems'] = array();
-        $forum_vid = variable_get('forum_nav_vocabulary', '');
         foreach ($vocabularies as $vocab) {
-          if ($vocab->vid != $forum_vid) {
-            $vocabname = $vocab->name;
-            $fieldlabel = t('Pattern for all %vocab-name paths', array('%vocab-name' => $vocabname));
-            $settings['patternitems'][$vocab->vid] = $fieldlabel;
-          }
+          $vocabname = $vocab->name;
+          $fieldlabel = t('Pattern for all %vocab-name paths', array('%vocab-name' => $vocabname));
+          $settings['patternitems'][$vocab->vid] = $fieldlabel;
         }
       }
       return (object) $settings;
@@ -48,14 +45,13 @@
  * 
  */ 
 function taxonomy_pathauto_bulkupdate() {
-  $forum_vid = variable_get('forum_nav_vocabulary', '');
-  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', tid) = src WHERE src IS NULL AND vid != %d";
-  $result = db_query_range($query, $forum_vid, 0, variable_get('pathauto_max_bulk_update', 50));
+  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', tid) = src WHERE src IS NULL";
+  $result = db_query_range($query, 0, variable_get('pathauto_max_bulk_update', 50));
   
   $count = 0;
   $placeholders = array();
   while ($category = db_fetch_object($result)) {
-    $count = _taxonomy_pathauto_alias($category, 'bulkupdate') + $count;
+    $count += _taxonomy_pathauto_alias($category, 'bulkupdate');
   }
   
   drupal_set_message(format_plural($count,
@@ -75,69 +71,9 @@
 
   $placeholders = pathauto_get_placeholders('taxonomy', $category);    
   
-  $forum_vid = variable_get('forum_nav_vocabulary', '');
-  // If we're in a forum vocabulary, also create a forum container, forum, or forum topic alias.
-  if (module_exists('forum') && $forum_vid == (int)$category->vid) {
-    $src = 'forum/'. $category->tid;
-    if ($alias = pathauto_create_alias('forum', $op, $placeholders, $src, $category->tid, $vid)) {
-      $count++;
-    }
-  }
-  else {
-    $src = 'taxonomy/term/'. $category->tid;
-    if ($alias = pathauto_create_alias('taxonomy', $op, $placeholders, $src, $category->tid, $category->vid)) {
-      $count++;
-    }
+  $src = 'taxonomy/term/'. $category->tid;
+  if ($alias = pathauto_create_alias('taxonomy', $op, $placeholders, $src, $category->tid, $category->vid)) {
+    $count++;
   }
   return $count;
 }
-
-
-/*
- * Implementation of hook_pathauto() for forum module
- */
-function forum_pathauto($op) {
-  switch ($op) {
-    case 'settings':
-      $settings = array();
-      $settings['module'] = 'forum';
-      $settings['token_type'] = 'taxonomy';
-      $settings['groupheader'] = t('Forum path settings');
-      $settings['patterndescr'] = t('Pattern for forums and forum containers');
-      $settings['patterndefault'] = t('[vocab-raw]/[catpath-raw]');
-      $patterns = token_get_list('taxonomy');
-      foreach ($patterns as $type => $pattern_set) {
-        if ($type != 'global') {
-          foreach ($pattern_set as $pattern => $description) {
-            $settings['placeholders']['['. $pattern .']'] = $description;
-          }
-        }
-      }
-      $settings['supportsfeeds'] = '0/feed';
-      $settings['bulkname'] = t('Bulk generate forum paths');
-      $settings['bulkdescr'] = t('Generate aliases for all existing forums and forum containers which do not already have aliases.');
-      return (object) $settings;
-    default:
-      break;
-  }
-}
-
-
-/**
- *  Generate aliases for all forums and forum containers without aliases
- */
-function forum_pathauto_bulkupdate() {
-  $forum_vid = variable_get('forum_nav_vocabulary', '');
-  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('forum/', tid) = src WHERE vid = %d AND src IS NULL";
-  $result = db_query_range($query, $forum_vid, 0, variable_get('pathauto_max_bulk_update', 50));
-
-  $count = 0;
-  $placeholders = array();
-  while ($category = db_fetch_object($result)) {
-    $count = _taxonomy_pathauto_alias($category, 'bulkupdate') + $count;
-  }
-
-  drupal_set_message(format_plural($count,
-    "Bulk update of forums and forum containers completed, one alias generated.",
-    "Bulk update of forums and forum containers completed, @count aliases generated."));
-}
\ No newline at end of file
Index: pathauto/pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.1.2.19
diff -u -r1.1.2.19 pathauto.inc
--- pathauto/pathauto.inc	19 Nov 2007 22:18:27 -0000	1.1.2.19
+++ pathauto/pathauto.inc	29 Nov 2007 22:09:02 -0000
@@ -63,6 +63,39 @@
 }
 
 /**
+ * Returns old alias and pid if there is already an alias pointing to a different item
+ * 
+ * @param string $src
+ *   A string that is the internal path
+ * 
+ */
+function _pathauto_existing_alias_data ($src) {
+  $output = array(
+    'pid' => '',
+    'old_alias' => ''
+  );
+  $result = db_query("SELECT pid, dst FROM {url_alias} WHERE src='%s'", $src);
+  if ($data = db_fetch_object($result)) {
+    // The item is already aliased, check what to do...
+    switch (variable_get('pathauto_update_action', 2)) {
+      // Replace old alias - remember the pid to update
+      case 2:
+      case 3:
+        $output['pid'] = $data->pid;
+      // Add new alias in addition to old one
+      case 1:
+        $output['old_alias'] = $data->dst;
+        break;
+      // Do nothing
+      case 0:
+      default:
+        break;
+    }
+  }
+  return $output;
+}
+
+/**
  * Clean up a string value provided by a module, resulting in a
  * string containing only alphanumerics and separators
  * @param $string
@@ -193,31 +226,29 @@
     return '';
   }
 
+  if ($module == 'taxonomy') {
+    // Get proper path for term.
+    $term_path = taxonomy_term_path(taxonomy_get_term($entity_id));
+    if ($term_path != $src) {
+      // Quietly alias 'taxonomy/term/[tid]' with proper path for term.
+      $update_data = _pathauto_existing_alias_data($src);
+      _pathauto_set_alias($src, $term_path, $module, $entity_id, $update_data['pid'], FALSE, $update_data['old_alias']);
+      // Set $src as proper path.
+      $src = $term_path;
+    }
+  }
+  
   // Special handling when updating an item which is already aliased.
   $pid = NULL;
   $old_alias = NULL;
   if ($op == 'update' or $op == 'bulkupdate') {
-    $result = db_query("SELECT pid, dst FROM {url_alias} WHERE src='%s'", $src);
-    if ($data = db_fetch_object($result)) {
-      // The item is already aliased, check what to do...
-      switch (variable_get('pathauto_update_action', 2)) {
-        // Do nothing
-        case 0:
-          return '';
-        // Add new alias in addition to old one
-        case 1:
-          $old_alias = $data->dst;
-          break;
-        // Replace old alias - remember the pid to update
-        case 2:
-        case 3:
-          $pid = $data->pid;
-          $old_alias = $data->dst;
-          break;
-        default:
-          break;
-      }
-    }
+    if (variable_get('pathauto_update_action', 2) == 0) {
+      // Do nothing
+      return '';
+    }
+    $update_data = _pathauto_existing_alias_data($src);
+    $pid = $update_data['pid'];
+    $old_alias = $update_data['old_alias'];
   }
 
   // Replace the placeholders with the values provided by the module,
@@ -255,12 +286,9 @@
   // by the module
   if (variable_get('pathauto_'. $module .'_applytofeeds', FALSE)) {
     $feedappend = variable_get('pathauto_'. $module .'_supportsfeeds', '');
-    // If we're in a forum, the src doesn't form the base of the rss feed
-    // TODO refactor this out
-    if ($module == 'forum') {
-      $pieces = explode('/', $src);
-      $tid = $pieces[1];
-      _pathauto_set_alias("taxonomy/term/$tid/$feedappend", "$alias/feed", $module, $entity_id, NULL, $verbose);
+    // For taxonomies, the src doesn't always form the base of the rss feed (ie. forum, image galleries)
+    if ($module == 'taxonomy') {
+      _pathauto_set_alias("taxonomy/term/$entity_id/$feedappend", "$alias/feed", $module, $entity_id, NULL, $verbose);
     }
     else {
       _pathauto_set_alias("$src/$feedappend", "$alias/feed", $module, $entity_id, NULL, $verbose);
Index: pathauto/pathauto.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v
retrieving revision 1.44.4.61
diff -u -r1.44.4.61 pathauto.module
--- pathauto/pathauto.module	25 Nov 2007 15:57:41 -0000	1.44.4.61
+++ pathauto/pathauto.module	29 Nov 2007 22:09:03 -0000
@@ -650,7 +650,7 @@
           //If the category is deleted, remove the path aliases
           $category = (object) $object;
           path_set_alias('taxonomy/term/'. $category->tid);
-          path_set_alias('forum/'. $category->tid);
+          path_set_alias(taxonomy_term_path($category));
           path_set_alias('taxonomy/term/'. $category->tid .'/0/feed');
           break;
         default:
