Validate does not work with drafts enabled #3576
Replies: 4 comments 1 reply
-
Same for 'required'. This an even bigger problems, since it can give all sort of errors on the frontend. The frontend expect a value to be there, since it is required. When running a preview website, where API requests are caleld with ?draft=true parameter, this will raise problems |
Beta Was this translation helpful? Give feedback.
-
Hey @silveltman — i see what you are running into here. The problem is that drafts can deliberately be saved as partially complete, and this is intentional in a lot of cases. It is also required for It's possible that we can expose a new setting so that if you have drafts enabled, but not autosave, we could prevent incomplete drafts from being saved. This is a feature request though because this is technically functioning as intended. I think we can look into exposing a new option here soon though. Let me convert this to a Roadmap item and we will get this sorted for you! |
Beta Was this translation helpful? Give feedback.
-
I understand what you mean and actually see the benefit in this. For me a solution could be the following:
Names for these buttons could be: Save draft, Publish, and Build site |
Beta Was this translation helpful? Give feedback.
-
This was added via the collection config |
Beta Was this translation helpful? Give feedback.
-
Link to reproduction
/
To Reproduce
Describe the Bug
You will see that the validation error only appears when clicking publish, and not when clicking save draft.
This is a problem in my case, because I'm trying to do the following:
When someone changes a slug, check if a siblingdata checkbox called 'confirm' is true, so that it adds an extra step for changing a slug.
Payload Version
2.0.3
Adapters and Plugins
mongo, vite
Beta Was this translation helpful? Give feedback.
All reactions