8000 Redirection plugin from field should be unique · Issue #12959 · payloadcms/payload · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Redirection plugin from field should be unique #12959
Open
@Shubham-Tiwari-Anywhere

Description

Describe the Bug

  • I faced 1 issue where i duplicated a redirection doc and it duplicated with the same from field value, which leads to 2 docs with same redirection from value. If we could add the unique: true to the from field, it will create a new string on duplication.
  • Other issue i faced is that we could create multiple redirects with same from value, it will be good to have a validation hook which throws error if we pass an existing from value as 1 page could have 1 redirection only.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/blob/main/packages/plugin-redirects/src/index.ts

Reproduction Steps

  • Create a redirection doc under redirection collection
  • Duplicate that doc and publish the new redirection doc, it will publish with same value

Which area(s) are affected? (Select all that apply)

plugin: other

Environment Info

Binaries:
  Node: 20.13.1
  npm: 10.5.2
  Yarn: N/A
  pnpm: 9.0.0
Relevant Packages:
  payload: 3.39.1
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:46 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T8112
  Available memory (MB): 24576
  Available CPU cores: 8

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0