From d0ca4d4a7c8988945476a844bfa734abdab4c1c6 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 6 Sep 2023 15:21:59 +0200 Subject: [PATCH] wip #6248 @0.25 --- .../views/fields/select2_from_array.blade.php | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/resources/views/fields/select2_from_array.blade.php b/src/resources/views/fields/select2_from_array.blade.php index 16b1166..80afbdd 100644 --- a/src/resources/views/fields/select2_from_array.blade.php +++ b/src/resources/views/fields/select2_from_array.blade.php @@ -7,12 +7,10 @@ if(null===$o || $o==='null'){ return false; } - if(!is_array($o)){ + if(is_scalar($o)){ return $o==$key; - }else { - return in_array($key,$o); } - return false; + return in_array($key,$o); } } @@ -24,20 +22,21 @@ if($ajax){ } @endphp - + @include('crud::fields.inc.wrapper_start') @if (isset($field['allows_multiple']) && $field['allows_multiple']==true) @endif