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
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
The text was updated successfully, but these errors were encountered:
…umns (dmaicher)
This PR was merged into the 3.2 branch.
Discussion
----------
[DoctrineBridge] Fixed validating custom doctrine type columns
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21619
| License | MIT
| Doc PR | -
This fixes#21619 by not assuming the invalid `$value` is a Doctrine entity if its an object
Commits
-------
ad59370 [DoctrineBridge] Fixed validating custom doctrine type columns
Uh oh!
There was an error while loading. Please reload this page.
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:
symfony/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
Line 140 in b3ced86
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
The text was updated successfully, but these errors were encountered: