[11.2-only] Adopt `AtLeastOneOf` validation constraint for cardinality validation

Created on 27 May 2025, 7 days ago

Overview

📌 [later phase] Support matching `{type: array, …}` prop shapes Postponed added type: array support and added this:

          # TRICKY: unfortunately, `field.storage_settings.*` does not store cardinality, but the FieldStorageConfig
          # entity does (config schema: `field.storage.*.*`). Hence the need for an additional key-value pair.
          cardinality:
            type: integer
            label: 'Maximum number of values accepted by this component prop'
            # @todo Uncomment this once XB requires Drupal >=11.2
            #constraints:
            #  AtLeastOneOf:
            #    constraints:
            #      - Choice:
            #          # @see \Drupal\Core\Field\FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
            #          - -1
            #      - Range:
            #          min: 2
            # Optional *if* the default of cardinality = 1 should be used.
            requiredKey: false

See the change record for 📌 Remove the restriction from RecursiveContextualValidator that prevents using custom groups. Needs review , which ships with Drupal 11.2x..

Proposed resolution

User interface changes

📌 Task
Status

Postponed

Version

0.0

Component

Config management

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024