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
If you specify a custom error message for a field with an asterisk, the default error text will be used.
This is due to the fact that a field without an asterisk is passed to generate an error (it contains the full path of the key)
Steps to Reproduce
$data = [
'user' => [
['name' => null],
['name' => null],
]
];
$validator = Services::validation();
$validator->setRules(['user.*.name' => 'required'], ['user.*.name' => ['required' => 'Required']]);
$validator->run($data);
dd($validator->getErrors());
// array (2) [// 'user.0.name' => 'The user.*.name field is required.'// 'user.1.name' => 'The user.*.name field is required.'// ]
CodeIgniter4 Version
dev
What happened?
If you specify a custom error message for a field with an asterisk, the default error text will be used.
This is due to the fact that a field without an asterisk is passed to generate an error (it contains the full path of the key)
Steps to Reproduce
Expected Output
The text was updated successfully, but these errors were encountered: