You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validation is a little different in CI4 so it needs to be reworked in the Login Controller. Specifically set_message() needs to be converted. I think the validator object needs to be passed as a function parameter because it's not global like form_validation.
@jekkos it's unclear to me why app\Controllers\Login.php and app\Libraries\MY_Validation.php have the same sets of functions. Can you help me understand the backstory here? I'm sort of stuck here on how to port this to CI4 format. It turns out that CI4 does have a an ability to call a function as a rule, similar to callbacks, but it's not clear how to pass parameters to this function.
Currently on application load I get the following exception
ArgumentCountError
Too few arguments to function CodeIgniter\Validation\Validation::__construct(), 0 passed in /[REDACTED]/vendor/codeigniter4/framework/system/Validation/Validation.php on line 522 and exactly 2 expected
That traces back to line 24 in the Login controller if(!$this->validate(['username' => 'required|login_check']))
Activity
[-]Fix validation in CI4 Login controller[/-][+]CI4: Fix validation in Login controller[/+]objecttothis commentedon Dec 1, 2022
https://codeigniter4.github.io/userguide/installation/upgrade_validations.html?highlight=validation
Also there is no callback in CI4 which we are relying on.
objecttothis commentedon Dec 1, 2022
@jekkos it's unclear to me why app\Controllers\Login.php and app\Libraries\MY_Validation.php have the same sets of functions. Can you help me understand the backstory here? I'm sort of stuck here on how to port this to CI4 format. It turns out that CI4 does have a an ability to call a function as a rule, similar to callbacks, but it's not clear how to pass parameters to this function.
https://forum.codeigniter.com/showthread.php?tid=84992
Currently on application load I get the following exception
That traces back to line 24 in the Login controller
if(!$this->validate(['username' => 'required|login_check']))objecttothis commentedon Jan 27, 2023
As of 4.1.6 there was a slight change to validation results https://codeigniter.com/user_guide/installation/upgrade_416.html#validation-result-changes. We need to check to make sure our results are still as expected.
objecttothis commentedon Feb 2, 2023
Done