Possible fix for boolean field check

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-03-22 13:47:43 +00:00
parent 169973e697
commit 8c92198636

View file

@ -185,15 +185,18 @@ class Asset extends Depreciable
$model = AssetModel::find($this->model_id);
if (($model) && ($model->fieldset)) {
foreach ($model->fieldset->fields as $field){
if($field->format == 'BOOLEAN'){
$this->{$field->db_column} = filter_var($this->{$field->db_column}, FILTER_VALIDATE_BOOLEAN);
}
}
$this->rules += $model->fieldset->validation_rules();
}
}
foreach ($this->model->fieldset->fields as $field){
if($field->format == 'BOOLEAN'){
$this->{$field->db_column} = filter_var($this->{$field->db_column}, FILTER_VALIDATE_BOOLEAN);
}
}
return parent::save($params);
}