-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validation][RFC] Allow to mix group sequence and validation group #7204
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
Comments
👍 |
Hi! This seems to be a duplicate of #7146. Once this is implemented, you can simply do: $validator->validate($branch, new GroupSequence(array('Preview', 'Branch', 'Step2')); |
Thank you for your very good / fast support. I read #7146 ; but I did not really understand this issue. I do not understand something else: in And my last question, have you a ETA for this feature ? (I really don't want to push you, really) Thanks, again |
Yes, the example I gave was just exemplary. The point is that you will be able to pass custom group sequences at validation time (also by passing them to the Unfortunately no ETA yet, but you're welcome to send a PR ;) |
PR #10287 should correct it right ? Does it still work ? |
@shinab can you fork symfony standard and add the minimum of code to reproduce your issue? Thanks! |
Fork is here https://github.com/shinab/symfony-standard Test scenario With current implementation, validation should fail directly after group3, but it passed thougt group2 and group1 too. If you comment validation_groups in MyEntityType, validation fail after group1 as expected. |
Any news on this ? May I have to open a new issue ? |
Yes you can, sorry I'll try to find some time this week-end to look at it. |
It looks working when you create $sequence = new GroupSequence(array());
$sequence->cascadedGroup = new GroupSequence(['group3', 'group2']);
$resolver->setDefaults([
'data_class' => 'AppBundle\Entity\MyEntity',
'validation_groups' => $sequence,
]); Checked on Symfony 2.8.14 |
I would like to know if it is possible to mix validation group and group sequence ?
I used GroupSequence like this :
And it works like a charm.
But now, I want to preview the branch configuration. So I do not need validate everything. I just want to validate
configurationVariables
andconfigurationTemplate
in a first step, and then the whole configuration withProjectAssert\Configuration
in a second step.So I added
groups={"preview"}
onconfigurationVariables
andconfigurationTemplate
.But I do not know how to add a group on my validation sequence.
AFAIK, a POPO can attach only one GroupSequence, and a GroupSequence can not be inside a group.
The text was updated successfully, but these errors were encountered: