-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending base validation fails. #17631
Comments
The whole validation thing in Cake is quite buggy, as pointed out earlier ( #12697 ). As soon as the validation provider is configured in any way, even core rules fail with the above. The main reason seems to be that in this case, the 3rd arg is set with this array instead as $context instead of the expected $regex: [
'newRecord' => false,
'data' => [
...
],
'field' => 'weight',
'providers' => [ ],
] |
My guess would be that because if ($this->_pass) {
$args = array_values(array_merge([$value], $this->_pass, [$context]));
$result = $callable(...$args);
} else {
$result = $callable($value, $context);
}
if ($this->_pass) {
$args = array_values(array_merge([$value], $this->_pass, [$context]));
$result = $callable(...$args);
} else {
$result = $callable($value, $context);
} |
This feels also somewhat related to cakephp/localized#252 (comment) |
Description
It should be possible to use a different (extended) Validation class for all validators
https://book.cakephp.org/5/en/core-libraries/validation.html#adding-validation-providers
As per book in bootstrap:
leads to
But it is just
CakePHP Version
5.0
PHP Version
8.2
The text was updated successfully, but these errors were encountered: