mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Validate custom fieldset only if the asset have one
This commit is contained in:
parent
26cababc43
commit
98b78837e1
|
@ -196,12 +196,12 @@ class Asset extends Depreciable
|
|||
|
||||
if (($model) && ($model->fieldset)) {
|
||||
$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);
|
||||
foreach ($this->model->fieldset->fields as $field){
|
||||
if($field->format == 'BOOLEAN'){
|
||||
$this->{$field->db_column} = filter_var($this->{$field->db_column}, FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue