From: Vincent Vanwaelscappel Date: Thu, 3 Mar 2022 13:07:41 +0000 (+0100) Subject: wait #5141 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=999701887c50e34dad86c6fa9476f90b31f1c847;p=cubist_cms-back.git wait #5141 @1.5 --- 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); }