md-systems / redirect

DEPRECATED: Redirect moved back to drupal.org, use the official repository.
https://www.drupal.org/project/redirect
21 stars 29 forks source link

Fix redirect_path_update() #96

Closed danylevskyi closed 6 years ago

danylevskyi commented 8 years ago

Redirect module crashes in redirect_path_update() with Integrity constraint violation: 1062 Duplicate entry '5WDyk0tILigTJ0G3fwSptWecGOuwGZuJJy_Nsmg3Ebk' for key 'hash' if a redirect exists already.

findMatchingRedirect() never finds duplicate because path alias always contains /.

Berdir commented 8 years ago

Nice catch. Would be nice to have test coverage for this, we have existing tests that rename entities, so it shouldn't be hard to extend them to cover this scenario.