Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.1.10 |
When the unique field selected is a field with a Doctrine Custom Type, and there is a violation in the validation (i.e., the value already exists in the database), the method validate in UniqueEntityValidator throws a Doctrine/Common/Persistence/Mapping/MappingException: The class 'Whatever' was not found in the chain configured namespaces AppBundle\Entity
This is due to the modifications introduced in this commit: b3ced86
And is due to this method that is called to build the violation error in the validate method:
If the field value is an object (as in the case of a Doctrine custom type), it assumes that it's a Doctrine entity and try to get its identifiers, and there is when the exception is thrown, because the object is not an entity and it's not mapped