-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 8.10
-
Release Notes Summary:Constraint validation applies on all document properties at creation
-
Backlog priority:500
-
Upgrade notes:
-
Sprint:nxcore 9.3.9
-
Story Points:3
Currently only the dirty fields are used by the validation service during document creation
DocumentValidationReport report = getValidationService().validate(docModel, true);
@Override public DocumentValidationReport validate(DocumentModel document, boolean dirtyOnly) { List<ConstraintViolation> violations = new ArrayList<ConstraintViolation>(); DocumentType docType = document.getDocumentType(); if (dirtyOnly) { for (DataModel dataModel : document.getDataModels().values()) { Schema schemaDef = getSchemaManager().getSchema(dataModel.getSchema()); for (String fieldName : dataModel.getDirtyFields()) {
Because of that, it is not possible to check the constraints on a field which was not set in a WebUI creation form, for example in this case:
1) A field is declared as required in the schema definition.
2) In the WebUI creation form, I use an inputText where the field is not required
3) I submit the form
4) The document is created without any error
The expected behavior is that an error in shown in the creation form.
- is duplicated by
-
NXP-23485 Fix FT failure in ITCoverageNavigationTest
- Resolved
- is related to
-
NXP-23548 Fix Creating BCContract through REST API
- Resolved
-
NXP-19580 Apply constraints validation on document creation using REST API
- Resolved
-
NXP-23256 Move validation after aboutToCreate event
- Resolved
- is required by
-
NXP-23866 Fix wrong DocumentModelImpl creation
- Resolved
-
NXP-24138 Add a flag to enable document validation for all properties during creation
- Resolved