Index: path_redirect.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/path_redirect/path_redirect.install,v
retrieving revision 1.2.2.6.2.26
diff -u -p -r1.2.2.6.2.26 path_redirect.install
--- path_redirect.install	1 Dec 2009 05:40:09 -0000	1.2.2.6.2.26
+++ path_redirect.install	14 Aug 2010 22:51:10 -0000
@@ -75,6 +75,8 @@ function path_redirect_schema() {
  */
 function path_redirect_install() {
   drupal_install_schema('path_redirect');
+  // path_redirect to run after pathauto to add redirects when pathauto changes the path.
+  db_query("UPDATE {system} SET weight = 2 WHERE name = 'path_redirect'");
 }
 
 /**
Index: path_redirect.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/path_redirect/path_redirect.module,v
retrieving revision 1.3.2.7.2.104
diff -u -p -r1.3.2.7.2.104 path_redirect.module
--- path_redirect.module	10 Aug 2010 04:46:01 -0000	1.3.2.7.2.104
+++ path_redirect.module	14 Aug 2010 22:51:11 -0000
@@ -230,7 +230,13 @@ function path_redirect_nodeapi(&$node, $
   switch ($op) {
     case 'presave':
       if (!empty($node->nid) && !empty($node->path)) {
-        path_redirect_check_alias_changed('node/' . $node->nid, $node->path, $node->language);
+        path_redirect_old_alias($node->nid, $node->language);
+      }
+      break;
+    case 'insert':
+    case 'update':
+      if (!empty($node->nid) && !empty($node->path)) {
+        path_redirect_check_alias_changed($node->nid, $node->path, $node->language);
       }
       break;
     case 'delete':
@@ -242,10 +248,25 @@ function path_redirect_nodeapi(&$node, $
 }
 
 /**
+ * Sets (if not set) and returns the old alias for a given node nid/language combination.
+ */
+function path_redirect_old_alias($nid, $language) {
+
+  static $aliases = array();
+
+  if (!isset($aliases[$nid])) {
+    $aliases[$nid] = drupal_get_path_alias('node/' . $nid, $language);
+  }
+
+  return $aliases[$nid];
+
+}
+
+/**
  * Creates a redirect if an URL alias is being changed.
  *
- * @param $path
- *   The base (normal) path.
+ * @param $nid
+ *   The node nid.
  * @param $new_alias
  *   The new alias for the path.
  * @param $language
@@ -253,12 +274,12 @@ function path_redirect_nodeapi(&$node, $
  * @return
  *   TRUE if a redirect was created, or FALSE otherwise.
  */
-function path_redirect_check_alias_changed($path, $new_alias, $language = '') {
+function path_redirect_check_alias_changed($nid, $new_alias, $language = '') {
   if (!variable_get('path_redirect_auto_redirect', 1) || empty($new_alias)) {
     return FALSE;
   }
-
-  $old_alias = drupal_get_path_alias($path, $language);
+  $path = 'node/' . $nid;
+  $old_alias = path_redirect_old_alias($nid, $language);
   if ($old_alias != $path && $old_alias != $new_alias) {
     // If the user is manually changing the path alias, add a redirect from the old alias to the node.
     $redirect = array(
