Issue #3616699: Fix Callback constraint fatal, Length/Range/Count Min/Max requirement, Direct-mode scoping bypass, and checkCondition() fatal
-
Fix field_validation_legacy kernel test suite bootstrap: enable the submodule in the test base's $modules, rename its schema file (was shadowing the main module's, breaking config schema resolution once the submodule was actually enabled), fix a PHPUnit-11 static-provider requirement, and a wrong-namespace import. Legacy suite: 96/104 errors -> 198/198 passing.
-
Fix Callback constraint rule fataling on every save: getConstraintOptions() returned the callback under a 'value' key; Symfony's Callback constraint constructor parameter is $callback, and Drupal's ConstraintFactory spreads options as named arguments, so the mismatch fataled outright.
-
Fix Length/Range/Count constraint rules requiring both Min and Max: only one is required by Symfony's own constraints. The blanket '#required' silently failed client-side with no error shown.
-
Fix 'Direct' validate mode silently ignoring role and condition scoping: it attaches the Symfony constraint straight to the field, bypassing FieldValidationConstraintValidator - the only place role/condition checks run. Now blocked at form-validation time instead of silently discarded.
-
Fix checkCondition() fataling when its condition references a field the entity doesn't have (deleted after the rule was saved, or hand-edited config). Now fails closed instead of crashing on a real form submission.
Full module kernel suite: 228/228 passing.
Closes #3616699