You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A server-side validation error removes the field's own validators (e.g. required) #6335
When the REST API reports a validation error for a form field, FormService.addErrorToField() keeps the error in place with setValidators(), which replaces all validators of the field. removeErrorFromField() then calls clearValidators(). From then on the field has lost its own validators, such as required, so the client no longer flags it.
Seen on DSpace10.0; the same code is on main.
To Reproduce
Start a new submission and leave a required field (e.g. Title) empty.
Click "Deposit": the server-side error is shown on the field.
Enter a value: the error goes away.
Clear the field again: no "required" error is shown on the client any more.
Expected behavior
After a server-side error has been removed, the field still has its own validators, and clearing a required field shows the "required" error again.
Activity