Open
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 redirectionfrom
value. If we could add theunique: true
to thefrom
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 existingfrom
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