- Issue created by @wim leers
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
🐛 PHPUnit Next Major tests failing Active is in, so this is unblocked!
- Merge request !1239Draft: Adopt `AtLeastOneOf` validation constraint for cardinality validation → (Open) created by thoward216
- 🇬🇧United Kingdom thoward216
Have updated the the MR and things are looking better. Now getting errors around the validation for the version constraint that was added/uncommented.
https://git.drupalcode.org/project/experience_builder/-/jobs/5827036#L4725 - 🇬🇧United Kingdom thoward216
I think this is failing as 'versioned_properties' does not contain the hash of the 'active_version' as its simply keyed as 'active'. So I'm not sure this is the correct constraint to be added here?
- 🇬🇧United Kingdom thoward216
Coming back around to this, as per #10.
A new components config with one version looks like this:
uuid: d973b1d2-df01-4f89-a309-fe83f34c9d9a langcode: en status: true dependencies: config: - experience_builder.js_component.test active_version: 8fe3be948e0194e1 versioned_properties: active: settings: prop_field_definitions: { } fallback_metadata: slot_definitions: { } label: test id: js.test provider: null source: js source_local_id: test category: '@todo'
New versions created adds them under `versioned_properties` as expected but as you can see above the hash `8fe3be948e0194e1` is not in `versioned _properties`. So either the above isn't structured as expected (though I'm sure there are a number of tests around this) OR the original constraint that was commented to add later maybe stale?
- Assigned to thoward216
- Status changed to Needs work
18 days ago 7:54am 29 July 2025 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
OR the original constraint that was commented to add later maybe stale?
Bingo! Turns out this was independently of this (low-priority) issue discovered while investigating a bug — see 📌 Disallow component trees with `component_version: active` Active , which is about to remove that
@todo 🥳.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
FYI: just landed 📌 Disallow component trees with `component_version: active` Active ; the
@todo
was corrected there — theAtLeastOneOf
didn't belong onactive_version
, but onversioned_properties
. - 🇬🇧United Kingdom thoward216
After rebasing and uncommenting the schema changes as mentioned in #13, there are a number of failing tests where the validation messages are not as expected.
An example:
'versioned_properties' => 'This value should satisfy at least one of the following constraints: [1] This value should be of the correct primitive type. [2] This value should be of the correct primitive type.'
To me this doesn't look right and the message is also duplicated. I spent some time investigating a bit further with @f.mazeikis we're not sure that the constraint AtLeastOneOf can be used with sequences? Looking at the core test AtLeastOneOfConstraintValidatorTest it only ever tests with strings or integers.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Shoot, it's possible that it doesn't play nice with config schema's
type: sequence
😬So then let's switch to:
constraints: Range: min: -1 NotEqualTo: - 0 - 1
Ah, nope, that also doesn't work, because
NotEqualTo
only accepts a single value. Argh! We also don't support https://symfony.com/doc/8.0/reference/constraints/When.htmlI'll investigate at a later time. Thanks for trying to get this done! 😊