--- path_redirect/path_redirect.module 2010-07-06 21:12:18.000000000 +0200 +++ path_redirect-NEW/path_redirect.module 2010-07-06 22:44:26.000000000 +0200 @@ -273,16 +273,17 @@ * TRUE if a redirect was created, or FALSE otherwise. */ function path_redirect_check_alias_changed($path, $new_alias, $language = '') { - if (!variable_get('path_redirect_auto_redirect', 1) || empty($new_alias)) { + $old_alias = drupal_get_path_alias($path, $language); + + if (!variable_get('path_redirect_auto_redirect', 1) || (empty($new_alias) && empty($old_alias))) { return FALSE; } - $old_alias = drupal_get_path_alias($path, $language); if ($old_alias != $base_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( 'source' => $old_alias, - 'redirect' => $new_alias, + 'redirect' => empty($new_alias) ? $path : $new_alias, ); return path_redirect_save($redirect); }