Currently the code just runs the following upon save:

  // Remove any other redirects from the same path
  db_query("DELETE FROM {path_redirect} WHERE path = '%s'", $edit['path']);

This is extremely poor handling of the possible situation where an existing path redirect is being handled, the user is never informed of the removal. It should at the very least display a message indicating the fields from the old record.

Patch will follow.

Comments

dave reid’s picture

There is a check in path_redirect_edit_validate() if the user is trying to add a duplicate 'from' redirect. What really should be done is:

if (!$edit['rid']) {
  $edit['rid'] = db_next_id('{path_redirect}_rid');
  db_query("INSERT ...");
}
else {
  db_query("UPDATE ...");
}
damienmckenna’s picture

Sounds like a great idea for another patch ;-)

dave reid’s picture

Status: Active » Closed (won't fix)

D5 is no longer supported.