Skip to content

Commit ce65fe3

Browse files
committed
bug #33834 [Validator] Fix ValidValidator group cascading usage (fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- [Validator] Fix ValidValidator group cascading usage | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `$this->context->getGroup()` returns `string` or `null`. `ContextualValidatorInterface::validate()` 3rd argument accepts an array but it must not contain `null` (its contract doesn't allow it). If it does, it will fail in `RecursiveContextualValidator::validateInGroup()` for example because of the `string` scalar type on the `$group` argument. (on 4.4) Note that in our "common" usage of the `Valid` constraint, the group in its validator will never be `null` because this constraint has a special treatment. However, if this validator is reused in a custom way, it can fail. Commits ------- 72684b001c [Validator] Fix ValidValidator group cascading usage
2 parents ac86a3c + 8fbed8e commit ce65fe3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Constraints/ValidValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public function validate($value, Constraint $constraint)
3333
$this->context
3434
->getValidator()
3535
->inContext($this->context)
36-
->validate($value, null, [$this->context->getGroup()]);
36+
->validate($value, null, $this->context->getGroup());
3737
}
3838
}

0 commit comments

Comments
 (0)