-
Notifications
You must be signed in to change notification settings - Fork 144
fix: redirect()->withInput() causes ValidationException #383
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
fix: redirect()->withInput() causes ValidationException #383
Conversation
@kenjis, I think we should merge this PR. |
+1 for merge now, It's breaking app at all. |
To merge, we need reviews. |
@kenjis For me this PR solved validation in forms. |
I don't like the production use of reflection. It's hard to trace this back in mobile, but couldn't this be solved by handling our validations from a clean instance? // Validate the registration
if (! single_service('validation')->setRules($this->registrationRules)->run($event)) {
... |
No, because the session data ($_SESSION) is global. See codeigniter4/CodeIgniter4#6381 |
That helps! Okay I am on board with the Reflection solution. It's a hack but we have a fix in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After applying comment MGatner , I don't see any problem.
0ede5ff
to
886d97f
Compare
886d97f
to
f0b5512
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #381
redirect()->withInput()
orwithErrors()
saves validation errors in the Session.And the check of the validation errors in Model (
checkQueryReturn()
),$this->validation->getErrors()
returns the errors in the Session.How to Test