While trying to save the node with alias, which already present in redirects list, i get an error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '7n7p7A5ELn1_RosSW_K05qvV-u0MHGJTVW6dD_YcgGQ' for key 'hash':
When i checked the sources of redirect module, I found, that redirect_validate() function does not work, when this error was found. I checked this by dsm($redirect) into the body of redirect_validate().
I temporary fixed this error by custom validation code into the redirect_save():
function redirect_save($redirect) {
$transaction = db_transaction();
$check = $redirect;
redirect_hash($check);
$existing = redirect_load_by_hash($check->hash);
if ($existing) {
form_set_error('source', t('The source path %source is already being redirected. Do you want to edit the existing redirect?', array('%source' => redirect_url($redirect->source, $redirect->source_options), '@edit-page' => url('admin/config/search/redirect/edit/'. $existing->rid))));
} else
try {
if (!empty($redirect->rid) && !isset($redirect->original)) {
...
Please review the module for this error.
Comments
Comment #1
jhchnc commentedI'm seeing this, too.
Comment #2
akoepke commentedJust had this happen as well.
Comment #3
dgtlmoon commentedSeems to already be in the code (I just tested)