Updated: Comment #98
This is a meta issue to track progress of the core validation API and its application to entities and fields.
Problem / Motivation
Entity validation needs to be untied from form validation, i.e. have a way to validate the properties (and fields) of an entity object. Currently, validation of an entity is mostly tied to the form system, only field API has a hardly used way to validate field data independently of a form.
If implementing web services or other custom ways to update an entity, APIs for validating the data are necessary. However, in those scenarios no forms are involved, so those should not be required. Also see.
- Add a validation API based on Symfony validators: done in .
- Implement the validation constraints for all core entity types and their base fields while leaving the form validation callbacks/methods as is.
- Replace form-specific validation code with calls to the validation API and map back violation messages to the corresponding form elements, see .
User interface changes
Minimal. We are only moving the logic in form validation callbacks/methods to constraint and validator classes that can be reused outside of forms.
(for validating allowed values)
|PASSED: [[SimpleTest]]: [MySQL] 48,070 pass(es).|
|FAILED: [[SimpleTest]]: [MySQL] 48,024 pass(es), 0 fail(s), and 3 exception(s).|
|FAILED: [[SimpleTest]]: [MySQL] 47,865 pass(es), 0 fail(s), and 158 exception(s).|