Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.163
diff -u -p -r1.163 path.module
--- modules/path/path.module	8 Jul 2009 07:46:10 -0000	1.163
+++ modules/path/path.module	30 Jul 2009 18:34:49 -0000
@@ -212,6 +212,51 @@ function path_node_delete($node) {
 }
 
 /**
+ * Implement hook_taxonomy_term_load().
+ */
+function path_taxonomy_term_load($terms) {
+  foreach ($terms as $term) {
+    $language = isset($term->language) ? $term->language : '';
+    $path = 'taxonomy/term/' . $term->tid;
+    $alias = drupal_get_path_alias($path, $language);
+    if ($path != $alias) {
+      $term->path = $alias;
+    }
+  }
+}
+
+/**
+ * Implement hook_taxonomy_term_insert().
+ */
+function path_taxonomy_term_insert($term) {
+  if (user_access('create url aliases') || user_access('administer url aliases')) {
+    $language = isset($term->language) ? $term->language : '';
+    // Don't try to insert if path is NULL. We may have already set
+    // the alias ahead of time.
+    if (isset($term->path)) {
+      path_set_alias('taxonomy/term/' . $term->tid, $term->path, NULL, $language);
+    }
+  }
+}
+
+/**
+ * Implement hook_taxonomy_term_update().
+ */
+function path_taxonomy_term_update($term) {
+  if (user_access('create url aliases') || user_access('administer url aliases')) {
+    $language = isset($term->language) ? $term->language : '';
+    path_set_alias('taxonomy/term/' . $term->tid, isset($term->path) ? $term->path : NULL, isset($term->pid) ? $term->pid : NULL, $language);
+  }
+} 
+ 
+ /**
+ * Implement hook_taxonomy_term_delete().
+ */
+function path_taxonomy_term_delete($term) {
+  path_set_alias('taxonomy/term/' . $term->tid);
+}
+
+/**
  * Implement hook_form_alter().
  */
 function path_form_alter(&$form, $form_state, $form_id) {
@@ -247,6 +292,29 @@ function path_form_alter(&$form, $form_s
       );
     }
   }
+  elseif ($form_id == 'taxonomy_form_term' && empty($form['confirm'])) {
+    $path = isset($form['#term']['path']) ? $form['#term']['path'] : NULL;
+    $form['identification']['path'] = array(
+      '#type' => 'textfield',
+      '#title' => t('URL alias'),
+      '#default_value' => $path,
+      '#maxlength' => 255,
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#weight' => 0,
+      '#description' => t('Optionally specify an alternative URL by which this term can be accessed. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
+    );
+    if ($path) {
+      $form['identification']['path']['pid'] = array(
+        '#type' => 'value',
+        '#value' => db_query("SELECT pid FROM {url_alias} WHERE dst = :dst AND language = :language", array(
+          ':dst' => $path,
+          ':language' => !empty($form['#term']['language']) ? $form['#term']['language'] : ''
+        ))
+        ->fetchField(),
+      );
+    }
+  }
 }
 
 /**
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.488
diff -u -p -r1.488 taxonomy.module
--- modules/taxonomy/taxonomy.module	20 Jul 2009 18:51:34 -0000	1.488
+++ modules/taxonomy/taxonomy.module	30 Jul 2009 18:34:49 -0000
@@ -421,12 +421,12 @@ function taxonomy_term_save($term) {
   if (!empty($term->tid) && $term->name) {
     $status = drupal_write_record('taxonomy_term_data', $term, 'tid');
     field_attach_update('taxonomy_term', $term);
-    module_invoke_all('taxonomy_term_insert', $term);
+    module_invoke_all('taxonomy_term_update', $term);
   }
   else {
     $status = drupal_write_record('taxonomy_term_data', $term);
     field_attach_insert('taxonomy_term', $term);
-    module_invoke_all('taxonomy_term_update', $term);
+    module_invoke_all('taxonomy_term_insert', $term);
   }
 
   db_delete('taxonomy_term_relation')
