From: Vincent Vanwaelscappel Date: Mon, 28 Feb 2022 19:35:00 +0000 (+0100) Subject: wait #5127 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8d5464183af093e5d55af6a2ef9a0b9e0d89ae10;p=cubist_cms-back.git wait #5127 @0.5 --- diff --git a/src/resources/views/fields/dropzone_media.blade.php b/src/resources/views/fields/dropzone_media.blade.php index 768f07a..0d072ea 100644 --- a/src/resources/views/fields/dropzone_media.blade.php +++ b/src/resources/views/fields/dropzone_media.blade.php @@ -1,6 +1,14 @@ @if(isset($entry)) @include('crud::fields.inc.wrapper_start') @@ -152,6 +160,8 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? @push('crud_fields_scripts') getAllMedia() as $media) { @@ -169,10 +179,18 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $full = ''; } - try { - $thumb_url = $media->getUrl($field['thumb_conversion'] ?? null); - } catch (Exception $e) { - $thumb_url = ''; + $e = explode('.', $full); + $ext = mb_strtolower(array_pop($e)); + + if (in_array($ext, $images)) { + try { + $thumb_url = $media->getUrl($field['thumb_conversion'] ?? null); + } catch (Exception $e) { + + } + } + if (!isset($thumb_url)) { + $thumb_url = $blank; }