? maintenance_for_url_alias_extra_193825.patch
? message
? pathauto_pgsql_install_195044.patch
Index: pathauto.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.install,v
retrieving revision 1.1.4.22
diff -u -p -r1.1.4.22 pathauto.install
--- pathauto.install	17 Dec 2007 14:30:37 -0000	1.1.4.22
+++ pathauto.install	18 Dec 2007 13:36:08 -0000
@@ -101,6 +101,9 @@ function pathauto_install() {
  * Implementation of hook_uninstall().
  */
 function pathauto_uninstall() {
+  // Remove the url_alias_extra helper table
+  db_query("DROP TABLE {url_alias_extra}");
+
   // Delete all the pathauto variables and then clear the variable cache  
   db_query("DELETE FROM {variable} WHERE name LIKE 'pathauto_%'");
   cache_clear_all('variables', 'cache');
Index: pathauto.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v
retrieving revision 1.44.4.65
diff -u -p -r1.44.4.65 pathauto.module
--- pathauto.module	16 Dec 2007 21:51:13 -0000	1.44.4.65
+++ pathauto.module	18 Dec 2007 13:36:10 -0000
@@ -546,7 +546,7 @@ function pathauto_admin_delete_submit($f
         drupal_set_message(t('All of your path aliases have been deleted.'));
       }
       if ($key === 'all_pathauto_aliases') {
-        db_query('DELETE {url_alias} ua,  {url_alias_extra} uax FROM {url_alias} ua INNER JOIN {url_alias_extra} uax on ua.pid = uax.pid and ua.dst = uax.dst');
+        db_query("DELETE {url_alias} ua, {url_alias_extra} uax FROM {url_alias} ua INNER JOIN {url_alias_extra} uax ON ua.pid = uax.pid AND ua.dst = uax.dst AND uax.created_by = 'Pathauto'");
         drupal_set_message(t('All of your path aliases have been deleted.'));
       }
       $objects = _pathauto_objects_to_delete();
@@ -584,6 +584,7 @@ function pathauto_nodeapi(&$node, $op, $
       case 'delete':
         path_set_alias('$node/'. $category->tid);
         path_set_alias('$node/'. $category->tid .'/feed');
+        db_query("DELETE FROM {url_alias_extra} WHERE entity_type = 'node' AND entity_id = %d", $node->nid);
         break;
       default:
         break;
@@ -665,6 +666,7 @@ function pathauto_taxonomy($op, $type, $
           path_set_alias(taxonomy_term_path($category));
           path_set_alias('forum/'. $category->tid);
           path_set_alias('taxonomy/term/'. $category->tid .'/0/feed');
+          db_query("DELETE FROM {url_alias_extra} WHERE entity_type = 'taxonomy' AND entity_id = %d", $category->tid);
           break;
         default:
           break;
@@ -729,8 +731,17 @@ function pathauto_user($op, &$edit, &$us
       path_set_alias('user/'. $user->uid .'/track');
       path_set_alias('user/'. $user->uid .'/track/feed');
 
+      db_query("DELETE FROM {url_alias_extra} WHERE entity_type = 'user' AND entity_id = %d", $user->uid);
       break;
     default:
       break;
   }
 }
+
+/*
+ * Implementation of hook_cron
+ */
+function pathauto_cron() {
+  // Clean up the url_alias_extra table
+  db_query("DELETE uae FROM {url_alias_extra} uae LEFT JOIN {url_alias} ua ON uae.pid = ua.pid WHERE ua.pid IS NULL");
+}
\ No newline at end of file
