[IMPLEMENTED] Enable different validations for “Draft” and “Published” content

I would like to be able to save a draft that is missing some required fields. However, I should not be allowed to publish my draft without being prompted to fill in the missing required fields.

The point is: Not everybody uses Publish the same way. Some users have Review steps and I guess they want to have have everybody filled in until it gets reviewed. So at least we need to make it configurable.

Good point. Maybe we could have a checkbox on the validation page for “Required to save a draft”. This way people adding content on large teams can share the work load without changing validation rules.

Hi @Sebastian
We are struggling on this issue with our Editorial team. They want to disable the required fields when saving drafts (as this is a native requirement for heavy publishing house functionality especially for onboarding more authors and making them create all the articles within the editor itself)

Is there any scripting or rule based workflows which can enable this that would be helpful.

You can make the validation through scripting, something like

if (!ctx.data.myField || !ctx.data.myField.iv) {
   reject('My field is required')

I have started conceptual work: [WIP] Conditional fields

1 Like

I was thinking about this feature request and it makes a lot of sense, but allowing different validations per status would make everything very complicated and also does not solve the problem, that validation is not triggered when publishing.

Therefore I was thinking about a few other steps, that introduce less changes, but fulfill the requirements

1. Validate on Publish (DEPLOYED)

A new setting per schemas that, when turned on, validates the content when it is published. This is already implemented, but not published yet.

2. Required on Publish (IMPLEMENTED)

A new validator that makes a field required when it is published and when the previous setting is set to true. This is already implemented.

3. Published References (IMPLEMENTED)

A new validation flag for reference fields. Currently, the references just need to exist and min and max items are just calculated based on the total number of references. With this flag the validation is calculated based on the total number of published references. For example, when you have 4 references added and 3 of them are published, it would also fill the requirement of not having more then 3 references.

4. Ask before unpublishing (IMPLEMENTED)

At the moment you get a confirmation dialog, when you want to delete a content item that is referenced by another content item. With this change you will also get the dialog when you unpublish an item.

5. References and Referencing view (WIP)

This feature idea is taken from Contentful. The idea is to provide 2 views for a content item with all content items referenced by the current item and all content items referencing the current content item. This feature is described here, but currently only available for Enterprise customers. I had no chance to try it out yet, but it seems like a valuable feature: https://www.contentful.com/blog/2020/09/02/visualize-your-content-in-the-contentful-web-app/

I have introduced all necessary APIS now to start with the UI.

This has been implemented.

This topic was automatically closed after 2 days. New replies are no longer allowed.