Skip to content

Bug: Error in Seeder  #2653

Description

@JoelCatantan

Direction
Record did not save upon seeding when there is validationRules property in model

Describe the bug
When seeding, the value became an array instead of string/null.

CodeIgniter 4 version
CI 4.0.2, Develop Branch

Affected module(s)
system\CodeIgniter\Validation\Validation::processRules

Expected behavior, and steps to reproduce if appropriate
Put a validationRules in model then create a seeder and run. I have in_list rule in my validation and the I got an Exception:
Type: TypeError Message: Argument 1 passed to CodeIgniter\Validation\Rules::in_list() must be of the type string or null, array given, called in ...\system\Validation\Validation.php on line 279 Filename: ...\system\Validation\Rules.php Line Number: 191
However, when I remove the in_list rule, no error occurs and yet, no record had been saved

Context

  • OS: Windows 10 pro
  • Web server: Apache 2.4
  • PHP version 7.4

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions