-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Update validator tests. #18368
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
Update validator tests. #18368
Conversation
Ensure validation process works as expected after adding multiple rules using Validator::add(). Refs #18367
My guess is that the reflection added is off once we have extended Table classes in between. |
I found the issue:
I guess that happens because the new code by reflection checks already only adds the context conditionally:
So in certain cases it gets not added, but then "stripped" even though it was never there. |
That's done in reference to the issue you submitted #17631. |
Yeah, that whole context thing being randomly at positions is bonkers in such an API. In terms of BC, I wonder how we can fix things up here. |
Ah, and my application is using
So I guess this could be the issue how to reproduce it. |
OK, now that I remember the "context" of the ticket/issue: Well, turns out with the updates around reflection we must remove that workaround. So removing // in your bootstrap
\Cake\Validation\Validator::addDefaultProvider('default', new \Cake\Validation\RulesProvider(\App\Validation\Validation::class)); makes it work Do we need to fix then something? As this could have other people run into the same trap if they modified this. |
I have already poked at the validator classes multiple times and each time fixing one issue seems to create another one. So I not looking forward to poking it again. |
We can merge this and maybe @markstory or someone wants to comment on the open ticket regarding the strategy moving forward. Then we can close this topic now that we know how to solve it. |
Ensure validation process works as expected after adding multiple rules using Validator::add(). Refs #18367