Index: pathauto.module
===================================================================
--- pathauto.module	(revision 3908)
+++ pathauto.module	(working copy)
@@ -217,6 +217,40 @@
  */
 function pathauto_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
   switch ($op) {
+    case 'load':
+      if (!isset($node->pathauto_perform_alias)) {
+        $pattern = FALSE;
+        // Find if there is an automatic alias pattern for this node type.
+        if (isset($node->language) && !empty($node->language)) {
+          $pattern = trim(variable_get('pathauto_node_'. $node->type .'_'. $node->language .'_pattern', ''));
+        }
+        if (!$pattern) {
+          $pattern = trim(variable_get('pathauto_node_'. $node->type .'_pattern', ''));
+          if (!$pattern) {
+            $pattern = trim(variable_get('pathauto_node_pattern', ''));
+          }
+        }
+        // If there's no pattern, there will be no $node->pathauto_perform_alias
+        // property set.
+        if (!$pattern) {
+          break;
+        }
+        
+        if (!empty($node->nid)) {
+          // If this is not a new node, compare it's current alias to the
+          // alias that would be genereted by pathauto. If they are the same,
+          // then keep the automatic alias enabled.
+          _pathauto_include();
+          $placeholders = pathauto_get_placeholders('node', $node);
+          $pathauto_alias = pathauto_create_alias('node', 'return', $placeholders, "node/{$node->nid}", $node->nid, $node->type, $node->language);
+          $node->pathauto_perform_alias = isset($node->path) && $node->path == $pathauto_alias;
+        }
+        else {
+          // If this is a new node, enable the automatic alias.
+          $node->pathauto_perform_alias = TRUE;
+        }
+      }
+      break;
     case 'presave':
       // About to be saved (before insert/update)
       if (!empty($node->pathauto_perform_alias) && isset($node->old_alias)
@@ -271,38 +305,9 @@
   // Process only node forms.
   if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) {
     $node = $form['#node'];
-    $pattern = FALSE;
 
-    // Find if there is an automatic alias pattern for this node type.
-    if (isset($form['language'])) {
-      $language = isset($form['language']['#value']) ? $form['language']['#value'] : $form['language']['#default_value'];
-      $pattern = trim(variable_get('pathauto_node_'. $form['type']['#value'] .'_'. $language .'_pattern', ''));
-    }
-    if (!$pattern) {
-      $pattern = trim(variable_get('pathauto_node_'. $form['type']['#value'] .'_pattern', ''));
-      if (!$pattern) {
-        $pattern = trim(variable_get('pathauto_node_pattern', ''));
-      }
-    }
-
     // If there is a pattern, show the automatic alias checkbox.
-    if ($pattern) {
-      if (!isset($node->pathauto_perform_alias)) {
-        if (!empty($node->nid)) {
-          // If this is not a new node, compare it's current alias to the
-          // alias that would be genereted by pathauto. If they are the same,
-          // then keep the automatic alias enabled.
-          _pathauto_include();
-          $placeholders = pathauto_get_placeholders('node', $node);
-          $pathauto_alias = pathauto_create_alias('node', 'return', $placeholders, "node/{$node->nid}", $node->nid, $node->type, $node->language);
-          $node->pathauto_perform_alias = isset($node->path) && $node->path == $pathauto_alias;
-        }
-        else {
-          // If this is a new node, enable the automatic alias.
-          $node->pathauto_perform_alias = TRUE;
-        }
-      }
-
+    if (isset($node->pathauto_perform_alias)) {
       // Add JavaScript that will disable the path textfield when the automatic
       // alias checkbox is checked.
       drupal_add_js(drupal_get_path('module', 'pathauto') .'/pathauto.js');
