lonnieezell / Bonfire2

CodeIgniter 4-based application skeleton
MIT License
127 stars 49 forks source link

More elaborate user-defined metafields validation rules are not processed fully #458

Closed dgvirtual closed 4 months ago

dgvirtual commented 4 months ago

When validation rules of $metaFields are defined more extensively, like in the case of baz below, only the first rule (in that particular case - the rule required is applied, while the subsequent rules are ignored.

    public $metaFields = [
                'Example Fields' => [
                    'foo' => ['label' => 'Foo', 'type' => 'text', 'validation' => 'permit_empty|string'],
                    'Bar' => ['type' => 'text', 'validation' => 'required|string'],
                    'baz' => [
                         'label' => 'Baz',
                         'type' => 'checkbox',
                         'validation' => [
                             'label' => 'Baz',
//'required is applied, but subsequent `in_list` is ignored;
                             'rules' => 'required|in_list[true,false]'
                         ],
                     ],
                ],
    ];

I intend to investigate this problem later.

dgvirtual commented 4 months ago

On further investigation I could not confirm this problem, must have been using rules incorrectly.