Problem/Motivation
When there is already a redirect on the database, but you try to add it with a trailing slash there is a fatal error:
1062 Duplicate entry for key 'hash'
Steps to reproduce
- Add a redirect with a trailing slash
- Save the redirect
- Try to add it again, but ensure it has a trailing slash on the Path
- Save it, it will throw the error
Proposed resolution
Add the rtrim($path, '/'); similar to 2932615 - Don't allow adding source paths with trailing slashes, they won't ever work but to the generateHash function on src/Entity/Redirect.php
Issue fork redirect-3255488
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
anybodyComment #4
anybody