Details
-
Story
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
None
Description
Field type validation does not run on save, and not when opening in edit mode. It runs only on publish. This is on purpose. It was made possible to save incomplete drafts, to allow editorial teams with editors responsible for different fields, where those fields are marked required.
https://issues.ibexa.co/browse/EZP-31574
However this creates the other problem: The user creates / edits a content, does a lot of work, everything looks good, until they click publish, and suddenly find out it's invalid. If the problem is an xml error from pasted text, it can be hard to find out what's wrong after having worked on it for some time.
How could this dilemma be solved? Product board: https://ibexa.productboard.com/all-notes/notes/37413687
Possible solution
Conceptually, these changes taken together could solve all these use cases:
- Separate requiredness validation from correctness validation.
- Allow validation to be run in a state where failure is ignored, and one where it isn't.
- a) Allow field type specs to require that correctness validation cannot be ignored for this FT.
b) Allow field type specs to require that data be rejected (not saved) if correctness validation fails. - Do validation like this:
Autosave and Save - Ignore requiredness validation, but show it visually. Ignore correctness validation, except for FTs that require it, but show it visually.
Inform the user that the data is saved but cannot be published until the validation errors are fixed.
Except if 3a), then inform the user that data can't be saved until the specific FT data is corrected.
Publish - Refuse on requiredness validation failure. Refuse on correctness validation failure.
Consequences
- With 3a), Save will not be possible until invalid data is corrected or removed from the form. With 3b), Save will succeed, but invalid data will not be saved, and be removed from the form (data is rejected).
- Correctness validation failures will be visible to the user as soon as they enter the data and autosave runs, or they click Save.
Designs
Attachments
Issue Links
- relates to
-
EZP-31574 Save incomplete draft
- Closed