Skip to content

Bug: validation run even if required_with condition #7557

Description

@shishamo

PHP Version

8.1

CodeIgniter4 Version

4.3.4

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

macOS

Which server did you use?

apache

Database

PostgreSQL 15.2

What happened?

even if the field in the required_with condition does not exist the other validation rules run

Steps to Reproduce

$data = [];

$validation = Services::validation();
$validation = $validation->setRules([
    'testField' => 'required_with[otherField]|valid_date',
]);

$result = $validation->run($data);

Expected Output

the validation rules should not run if the field required in the required_with condition does not exist?

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions