We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
7.4
4.2.1
Composer (using codeigniter4/appstarter)
codeigniter4/appstarter
Linux
fpm-fcgi
No response
Using the Built-in Validation class, custom validation error message previously set is cleared when setting another rule.
$va = \Config\Services::validation(); $va->setRule("field1", "Field 1", ["required"], ["required" => "You must input field 1"] ); $va->setRule("field2", "Field 2", ["required"], ["required" => "You must input field 2"] ); $va->run([]); $errors = $va->getErrors(); echo $errors["field1"] . "/" . $errors["field2"];
You must input field 1/You must input field 2
but
The field1 is required. / You must input field 2
It seems that the setRule() method calls getRules() internally to get rules already set, but it does not supply customErrors.
setRule()
getRules()
customErrors
The text was updated successfully, but these errors were encountered:
Thank you for good bug reporting.
I sent a PR #6241 Please check if you can.
Sorry, something went wrong.
kenjis
Successfully merging a pull request may close this issue.
PHP Version
7.4
CodeIgniter4 Version
4.2.1
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Linux
Which server did you use?
fpm-fcgi
Database
No response
What happened?
Using the Built-in Validation class,
custom validation error message previously set is cleared when setting another rule.
Steps to Reproduce
Expected Output
but
Anything else?
It seems that the
setRule()
method callsgetRules()
internally to get rules already set, but it does not supplycustomErrors
.The text was updated successfully, but these errors were encountered: