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

  1. Add a redirect with a trailing slash
  2. Save the redirect
  3. Try to add it again, but ensure it has a trailing slash on the Path
  4. 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

Command icon 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

MauHG created an issue. See original summary.

anybody’s picture

anybody’s picture

Related issues: