Enable client side validation in Create Process form #5519
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #3403
As discussed in the linked issue: The current behavior does not seem correct since no client side checking is ever performed during process creation for most field types. Apart from that: the current settings are not consistent since there is validation performed on radio buttons but not on normal text inputs.
My proposal would be to enforce that the user enters required values during process creation, to ensure that only valid processes are created.
I would prefer an even stricter validation on process creation (e.g. checking if the pattern of the field values conforms with the ruleset), but this would require more logic. So it would be good to prevent at least empty values on required fields.
The implemented logic ensures that the client validation is only triggered during process creation, since the element with id
editForm
exists only in the page layout used during process creation:item.required and (not empty param['editForm:save'] or not empty param['editForm:saveContinue'])
My implementation reflects my understanding of the issue: There should probably be no enforced client side validation in the editor since that might prevent people from saving whose task is just about structuring the document but not working on the metadata for example. But this could be discussed as well since actually enforcing values in required fields prevents errors earlier in the workflow (although metadata validation is always executed during export)
@andre-hohmann