From 999701887c50e34dad86c6fa9476f90b31f1c847 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 3 Mar 2022 14:07:41 +0100 Subject: [PATCH] wait #5141 @1.5 --- src/app/Magic/Fields/SelectFromModel.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/Magic/Fields/SelectFromModel.php b/src/app/Magic/Fields/SelectFromModel.php index f6ea42d..34909ba 100644 --- a/src/app/Magic/Fields/SelectFromModel.php +++ b/src/app/Magic/Fields/SelectFromModel.php @@ -36,6 +36,9 @@ class SelectFromModel extends Model $list = $field->pluck($pluckAttr); $findIds = []; foreach ($list as $id => $value) { + if (!is_string($value)) { + continue; + } if (stristr($value, $searchTerm)) { $findIds[] = $id; } @@ -49,7 +52,7 @@ class SelectFromModel extends Model protected function _preGetDefinition() { parent::_preGetDefinition(); - $o=$this->_getOptions(); + $o = $this->_getOptions(); $this->setAttribute('options', $o); } -- 2.39.5