Closed
Description
Symfony version(s) affected: 4.3.0
Description
I just upgraded my application to 4.3.0 and saw this bug.
We have a UserAddress
entity:
/**
* @ORM\Table(name="user_address")
*/
class UserAddress
{
/**
* @var Address
*
* @ORM\Embedded(class="Address")
*/
private $address;
// ...
}
with an embedded object Address
:
/**
* @ORM\Embeddable
*/
class Address
{
/**
* @var null|string
*
* @ORM\Column(name="first_name", type="string", length=255, nullable=true)
*/
private $firstName;
// ...
}
With new Doctrine auto-validation feature, it tries to access address.firstName
property, but in https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php#L39, we check if given property exists as it's given, so it can't work.
Possible Solution
Use symfony/property-accessor
? Instead of reflection metadata which does not contains embedded objects metadata.