- Issue created by @kunal.sachdev
- Merge request !8784#3461720 : Remove the custom groups restriction โ (Closed) created by kunal.sachdev
- Status changed to Needs review
11 months ago 8:34am 16 July 2024 - Status changed to RTBC
11 months ago 6:27pm 20 July 2024 - ๐จ๐ญSwitzerland znerol
Given the info from #2820364-77: Entity + Field + Property validation constraints are processed in the incorrect order โ , I'd be quite surprised if removing the
LogicException
would be sufficient to support composite validators. - Status changed to Needs work
10 months ago 9:29pm 14 August 2024 - ๐ฌ๐งUnited Kingdom longwave UK
If we're going to do this it would be good to have some test coverage to prove that it does work (or indeed, as #6 implies, doesn't work).
- First commit to issue fork.
- ๐ณ๐ฑNetherlands bbrala Netherlands
Tests are indeed needed, this one would be nice though to have. Commenting to put on my list. Think tests will not be very complicated here.
- ๐ณ๐ฑNetherlands bbrala Netherlands
I found a way to support the AtLeastOneOf constraint without any changes to groups. This enables some fun stuff, like:
constraints: AtLeastOneOf: constraints: - PluginExists: manager: plugin.manager.menu.link interface: 'Drupal\Core\Menu\MenuLinkInterface' - IdenticalTo: value: ''
Which is awesome and will help in other validation issues to support vlaidation without the need to make a lot of incompatible changes to migrate to needs null etc.
I think this is ready to get a proper review. :)
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
I reviewed this, looks perfect to me.
Test coverage is great.I wanted to create an issue for supporting all composite symfony constraints without having to reimplement them, but never got to it.
The good thing is that we ever end up doing it, this should be easily replaceable with that.
For consistency and DX, we should implement all of them. Maybe we need sibling issues for each of the Composites inSymfony\Component\Validator\Constraints
?I'm setting this to RTBC meanwhile.
- ๐ณ๐ฑNetherlands bbrala Netherlands
Not sure this is good, while writing tests for ๐ PDF files being downloaded RTBC i noted using these tests ends in an error where it thinks the constraint name is an array key. This means in on of the two something is weird i think. Setting abck to NW until i can investigate.
- ๐ณ๐ฑNetherlands bbrala Netherlands
Conclusion, it seems all good. SOrry for the confusion.
- ๐ฌ๐งUnited Kingdom longwave UK
+1 to creating sibling issue(s) as per @penyaskito in #13 to add the other compound constraints from Symfony.
NW for some nits but otherwise this looks good.
- ๐ณ๐ฑNetherlands bbrala Netherlands
Since the changes were so minimal, setting back to RTBC, ill also make an issue for the Composite contraints
- ๐ณ๐ฑNetherlands bbrala Netherlands
๐ [META] Support all composite Symfony contraints Active
- ๐ณ๐ฑNetherlands bbrala Netherlands
Test failure was unrelated nightwatch test. Rerunning, but seen that one too much to worry.
-
longwave โ
committed c84246a8 on 11.x
Issue #3461720 by bbrala, kunal.sachdev, longwave, penyaskito: Create...
-
longwave โ
committed c84246a8 on 11.x
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Awesome! Canโt wait to start using this ๐
- ๐ณ๐ฑNetherlands bbrala Netherlands
Yeah I think this one is very useful in a lot of cases. But there are more if you look at the linked meta. Which there you think would help most?
Automatically closed - issue fixed for 2 weeks with no activity.