Closed
Description
Symfony version(s) affected
7.1
Description
Hello,
When trying to upgrade to symfony 7.1 I get the following error.
!! In DoctrineLoader.php line 129:
!!
!! Warning: Undefined array key 0
After taking a look in the code the problem seems to be due to one of my entity validation constraints having a UniqueEntity constraint set like this :
App\Entity\User:
constraints:
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: email
But if I define the constraint like below I don't get the warning :
App\Entity\User:
constraints:
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: ['email']
How to reproduce
Add a UniqueEntity constraint without using the fields option and try to validate your entity
App\Entity\User:
constraints:
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: email
Possible Solution
No response
Additional Context
No response