• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI4 Validation is_unique in properties Config/Validation

#2
I am having the same trouble with the CI4 is_unique validation rule. Although I am indicating an ignore_field and an ignore_value in my rule definition (no spaces per the CI4 documentation), the validation continues to fail when editing an existing record. The validation message returned is:

The Permission name field must contain a unique value.

This situation is precisely the documented reason for having the ignore_field and an ignore_value options. Here is my rules array:

        $rules = [
            'perm' => [
                'label' => 'Permission name',
                'rules' => 'trim|required|is_unique[permission.perm,id,$perm_id]'
            ],
        ];

Am I missing something obvious?
Reply


Messages In This Thread
RE: CI4 Validation is_unique in properties Config/Validation - by never2ice - 03-19-2020, 02:24 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.