--- pathauto.module	2010-09-10 19:07:57.399332111 +0200
+++ pathautoNEW.module	2010-09-10 19:07:39.255356340 +0200
@@ -229,6 +229,23 @@ function pathauto_nodeapi(&$node, $op, $
          */
         $node->path = $node->old_alias;
       }
+      if (!empty($node->nid)) {
+        _pathauto_include();
+        if (variable_get('language_content_type_'. $node->type, 0)) {
+          $pattern = trim(variable_get('pathauto_node_'. $node->type .'_'. $node->language .'_pattern', FALSE));
+        }
+        if (empty($pattern)) {
+          $pattern = trim(variable_get('pathauto_node_'. $node->type .'_pattern', FALSE));
+          if (empty($pattern)) {
+            $pattern = trim(variable_get('pathauto_node_pattern', FALSE));
+          }
+        }
+        if ($pattern) {
+          $placeholders = pathauto_get_placeholders('node', $node);
+          $src = "node/$node->nid";
+          $node->autopath = pathauto_create_alias('node', 'return', $placeholders, $src, $node->nid, $node->type, $node->language);
+        }
+      }
       break;
     case 'insert':
     case 'update':
@@ -246,7 +263,7 @@ function pathauto_nodeapi(&$node, $op, $
       // Only do work if there's a pattern
       if ($pattern) {
         // Only create an alias if the checkbox was not provided or if the checkbox was provided and is checked
-        if (!isset($node->pathauto_perform_alias) || $node->pathauto_perform_alias) {
+        if ((!isset($node->pathauto_perform_alias) && (!isset($node->path) || $node->path == $node->autopath)) || $node->pathauto_perform_alias) {
           $placeholders = pathauto_get_placeholders('node', $node);
           $src = "node/$node->nid";
           $node->path = pathauto_create_alias('node', $op, $placeholders, $src, $node->nid, $node->type, $node->language);
