Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Bug gii/api generated rules: enum with trim #158

@siggi-k

Description

@siggi-k

initial

  • MariaDB
  • "schema.yaml" with attribute, which has type "enum"
    schema yaml
  • this new attribute can be NULL !

reproduction steps

  • execute ./yii gii/api to generate code and update model

bug

  • attribute is treated as a type string by applying trim in the function rules in abstract class from model.
    rules

  • this means that if the attribute was not passed and is therefore NULL, it becomes an empty string due to the validation. This in turn means that it cannot be saved as it is an enum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions