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
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
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