diff --git a/modules/path/path.module b/modules/path/path.module
index a267fd6..af496ba 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -196,11 +196,16 @@ function path_form_alter(&$form, $form_state, $form_id) {
       '#collapsed' => TRUE,
       '#description' => t('Optionally specify an alternative URL by which this node can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
     );
-    if ($path) {
-      $form['path']['pid'] = array(
-        '#type' => 'value',
-        '#value' => db_result(db_query("SELECT pid FROM {url_alias} WHERE dst = '%s' AND language = '%s'", $path, $form['#node']->language))
-      );
+    // If we are editing a node which has a path alias then store the pid
+    // of the unedited node's path alias in the form.
+    if (isset($form['#node']->nid)) {
+      $original_node = node_load($form['#node']->nid);
+      if (isset($original_node->path)) {
+        $form['path']['pid'] = array(
+          '#type' => 'value',
+          '#value' => db_result(db_query("SELECT pid FROM {url_alias} WHERE dst = '%s' AND language = '%s'", $original_node->path, $form['#node']->language))
+        );
+      }
     }
   }
 }
