From e104195796f9ea4286340e09a52be3cd3cc49b5e Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Wed, 9 Mar 2022 18:49:39 -0600 Subject: [PATCH] Convert value of the customfield element from string to boolean --- app/Models/Asset.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 6ddc597188..d0720c7938 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -199,6 +199,12 @@ class Asset extends Depreciable } } + 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); }