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
Which operating systems have you tested for this bug?
Linux
Which server did you use?
fpm-fcgi
Database
MariaDB 10.3.34
What happened?
when I set a custom rule for a field with asterisk and I set it's custom error message too. if the field is error it will show Validation.mycustom_rule instead the custom error message
Steps to Reproduce
my custom rule
public function mycustom_rule(string $value): bool
{
$theModel = new App\Models\TheModel();
if (empty($theModel->getData($value))) {
return true;
}
return false;
}
//make sure this rule return false so it can produce the error
my validation rules
$validationRules = [
'test_data.*' => [
'label' => 'test_data',
'rules' => 'required|mycustom_rule',
'errors' => [
'required' => '{field} is needed',
'mycustom_rule' => '{field} of {value} is not exist',
],
],
];
error messages that I got kinda like this (my actual error is in json)
the error messages that I got are more like when I didn't set any error message for my custom rule
kenjis
added
duplicate
Issue or pull request duplicates an already existing issue/pull request
and removed
bug
Verified issues on the current code behavior or pull requests that will fix them
labels
Aug 19, 2022
PHP Version
8.1
CodeIgniter4 Version
4.2.4
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
MariaDB 10.3.34
What happened?
when I set a custom rule for a field with asterisk and I set it's custom error message too. if the field is error it will show
Validation.mycustom_rule
instead the custom error messageSteps to Reproduce
the error messages that I got are more like when I didn't set any error message for my custom rule
Expected Output
Anything else?
ps : please forgive and correct me back if there are some mistyping because the actual codes and data is kinda secret
The text was updated successfully, but these errors were encountered: