Skip to content
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

[WIP][RFC][DX] Replace 'sylius' validation group with more specific groups #11887

Open
vvasiloi opened this issue Sep 29, 2020 · 1 comment
Open

Comments

@vvasiloi
Copy link
Contributor

Right now most of the validation is configured with group sylius.
A quick search through the files of Sylius 1.6.4 reveals 182 constraints configured with sylius group and only 6 constraints with other groups: sylius_customer_guest, sylius_promotion_coupon, sylius_review, sylius_customer_profile
This makes validation customization very cumbersome, because if a constraint need to be removed/replaced, then the sylius group can't be used anymore, so all other constraint aren't applied and have to be copy/pasted with a new group.
Replacing sylius group with more specific groups, like the 4 example above, will improve the developer experience while customizing validation.
This a draft, looking forward to get some feedback on this matter.

@JoppeDC
Copy link

JoppeDC commented Oct 8, 2020

Currently also having issues that would be way easier to solve if there were specific validation groups.

Issue comparable to this one.
The user wants to change a constraint on the product translation.

In creation form, you are using sylius_product form type and it uses validation groups of products. This would work if you edit translation directly through sylius.controller.product_translation:updateAction. So you need to configure validation_group per form, not per entity really.

It appears that the form will use the validation group of the parent. Just changing the child validation group won't disable that. Disabling the parent validation group (sylius), would mean all constraints are removed on the entire parent form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants