You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The automatic generation of rules() first generates 'required' and then 'default' values.
Consequently, default values are not considered when checking 'required'.
The 'required' rules should therefore be generated after 'default'.
I would like to know your use case can be achieved by any below options?
Option 1: set default value false in database table. And Yii model validation rules, remove required rule
Option 2: can you please check if yii\validators\RequiredValidator::$skipOnEmpty and/or yii\validators\RequiredValidator::$requiredValue fixes your use case
The automatic generation of rules() first generates 'required' and then 'default' values.
Consequently, default values are not considered when checking 'required'.
The 'required' rules should therefore be generated after 'default'.
Example
schema.yaml
This means that "verified" must be set. If it is not passed in a form, it must be saved as false.
The succession of generic "rules".
ACTUAL STATE
TARGET STATE
The text was updated successfully, but these errors were encountered: