Problem/Motivation

In #3461720: Create AtLeastOneOf constraint we created support for the first composite Symfony constraint. It was suggested to see if we can support all of them to make our life's easier. This meta is to manage those issues.

The classes are all in the namespace of Symfony\Component\Validator\Constraints:

  1. All
  2. AtLeastOneOf #3461720: Create AtLeastOneOf constraint
  3. Collection ( #3535734: Make block.settings.inline_block:* fully validatable
  4. Compound
  5. Existence (child of optional and required, not used alone i think)
  6. Optional #3535734: Make block.settings.inline_block:* fully validatable
  7. Required #3535734: Make block.settings.inline_block:* fully validatable
  8. Sequentially #3521131: Add support for Sequentially constraint
  9. When

Some seem already in use in Drupal\Core\Recipe\Recipe. Lets investigate what we can actually support using AtLeastOneOf as a template or if there is a better way with less code, do that.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

bbrala created an issue. See original summary.

bbrala’s picture

Issue summary: View changes
wim leers’s picture

Thanks @bbrala for pointing me here from #3461720-26: Create AtLeastOneOf constraint!

Sequentially is the one that I've definitely wished I had access to in Drupal a hundred times now. It'd allow many validation errors to be much more helpful; and not show errors that are almost pure noise when an earlier simpler validation constraint was violated. See https://symfony.com/doc/current/reference/constraints/Sequentially.html

bbrala’s picture

Let's use that as direction and see if we can do that. Creating a child issue.

bbrala’s picture

What the... with a little change in our validator we would be able to use these easily? What am i missing....

#3521131: Add support for Sequentially constraint

bbrala’s picture

Issue summary: View changes
bbrala’s picture

Next one we do should also add the logic in the create method to a trait to deduplocate.

alexpott’s picture

bbrala’s picture

bbrala’s picture

Issue summary: View changes

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.