Skip to content

Commit

Permalink
Fix for validation placeholder error #351 (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgvirtual authored Aug 21, 2023
1 parent 8021df5 commit 9b2c427
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Users/Config/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,25 @@ class Users extends BaseConfig
* Validation rules used when saving a user.
*/
public $validation = [
'email' => [
'label' => 'Email',
'rules' => 'required|valid_email|unique_email[{id}]',
'errors'=> [
'id' => [
// Needed for the id in email test;
// see https://codeigniter4.github.io/userguide/installation/upgrade_435.html
'rules' => 'permit_empty|is_natural_no_zero',
],
'email' => [
'label' => 'Email',
'rules' => 'required|valid_email|unique_email[{id}]',
'errors' => [
'unique_email' => 'This email is already in use. Could belong to a current or a deleted user.',
],
],
'username' => [
'username' => [
'label' => 'Username', 'rules' => 'required|string|is_unique[users.username,id,{id}]',
],
'first_name' => [
'label' => 'First Name', 'rules' => 'permit_empty|string|min_length[3]',
],
'last_name' => [
'last_name' => [
'label' => 'Last Name', 'rules' => 'permit_empty|string|min_length[3]',
],
];
Expand Down

0 comments on commit 9b2c427

Please sign in to comment.