Index: pathauto.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v
retrieving revision 1.110
diff -u -r1.110 pathauto.module
--- pathauto.module	20 May 2008 18:09:08 -0000	1.110
+++ pathauto.module	25 May 2008 22:33:14 -0000
@@ -261,6 +261,7 @@
 function pathauto_form_alter(&$form, $form_state, $form_id) {
   // Only do this for node forms
   if (isset($form['#id']) && ($form['#id'] == 'node-form') && arg(0) == 'node') {
+    $node = $form['#node'];
     // See if there is a pathauto pattern or default applicable
     if (isset($form['language'])) {
       $language = isset($form['language']['#value']) ? $form['language']['#value'] : $form['language']['#default_value'];
@@ -285,14 +286,19 @@
       $form['path']['pathauto_perform_alias'] = array(
         '#type' => 'checkbox',
         '#title' => t('Automatic alias'),
-        '#default_value' => TRUE,
+        '#default_value' => isset($node->pathauto_perform_alias) ? $node->pathauto_perform_alias : TRUE,
         '#description' => $output,
         '#weight' => 0
       );
+      
+      if (isset($node->pathauto_perform_alias) && isset($node->old_alias)
+          && $node->pathauto_perform_alias && $node->path == '' && $node->old_alias != '') {
+        $form['path']['path']['#default_value'] = $node->old_alias;
+        $node->path = $node->old_alias;
+      }
 
       //For Pathauto to remember the old alias and prevent the Path-module from deleteing it when Pathauto wants to preserve it
-      $old_alias = $form['path']['path']['#default_value'];
-      $form['path']['old_alias'] = array('#type' => 'value', '#value' => $old_alias);
+      $form['path']['old_alias'] = array('#type' => 'value', '#value' => $node->path);
     }
   }
 }
