Repository navigation
auto-increment unique fields #1026
Closed
DanRibbens
announced in
Roadmap
Replies: 4 comments 3 replies
0 replies
|
Here's an alternative solution for duplicating documents: #6157 |
0 replies
|
This has been mostly handled in v3. I rewrote duplicate to be done on the server side and when I did so I added default beforeDuplicate field level hooks for unique fields. This probably makes it not necessary to add a separate flag for the |
3 replies
|
The duplicate as draft was implemented in this PR. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When duplicating or creating new documents with similar unique fields, it can be difficult for the editor. An enhancement to solve this problem is to add a configuration option on fields that are unique to increment them automatically on the backend, before validation. This would allow a duplicated collection to have a text field for example being saved as
valueto be automatically changed tovalue-1for example, instead of failing with a validation error whenvalueis already present.This could work the same with number field types as well.
The config option:
autoIncrementneeds to be available for field typestextandnumber, only whenuniqueis true.All reactions