New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valid Constraints multiple groups apply only on one #27257
Comments
Hello @gregoirepaqueron, thank you for reporting this issue. /**
* @var Customer[]|Collection
* @Assert\Count(min="1", groups={"final"})
* @Assert\Valid(groups={"Customer", "final"})
* @ORM\OneToMany(targetEntity="Customer", mappedBy="mandate", cascade={"persist", "remove"})
*/
protected $customers; may fix your issue. |
Of course you need to add the The reason is that I don't know if we really want to support the case though, maybe we could better document it. ping @xabbuh |
No the problem comes from the |
Indeed, I missed the point that the |
Symfony version(s) affected: 3.4.8
I have a parent Entity with many childrens Entities. I have 2 groups of validations
Default
andfinal
.The goal is to use only the group
Default
through a non-restrictive form, in order to valid the integrity of datum sent, then on the last page, display all the errors message more restrictive, with combining the 2 groups.When i'm trying to validate on the 2 groups, i'm adding the 2 groups to
Valid()
constraint, but only 1 is applied.Exemple :
Mandate.php
Customer.php
CustomerController.php
I forced in database that
$firstName = null
and$email = "notvalidemail"
In the
$errors
list, i will find only that the email is incorrect, but not that the firstname should be not null.So, only the group
Default
is applied.The text was updated successfully, but these errors were encountered: