mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Merge pull request #12107 from snipe/fixes/500_on_missing_model_file
Fixed 500 error if model files are missing
This commit is contained in:
commit
ff0b68724f
|
@ -145,17 +145,21 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i></td>
|
<td><i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i></td>
|
||||||
<td>
|
<td>
|
||||||
@if ( Helper::checkUploadIsImage($file->get_src('assetmodels')))
|
@if ((Storage::exists('private_uploads/assetmodels/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('assetmodels'))))
|
||||||
<a href="{{ route('show/modelfile', ['modelID' => $model->id, 'fileId' => $file->id]) }}" data-toggle="lightbox" data-type="image" data-title="{{ $file->filename }}">
|
<a href="{{ route('show/modelfile', ['modelID' => $model->id, 'fileId' => $file->id]) }}" data-toggle="lightbox" data-type="image" data-title="{{ $file->filename }}">
|
||||||
<img src="{{ route('show/modelfile', ['modelID' => $model->id, 'fileId' =>$file->id]) }}" style="max-width: 50px;">
|
<img src="{{ route('show/modelfile', ['modelID' => $model->id, 'fileId' =>$file->id]) }}" style="max-width: 50px;">
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@if (Storage::exists('private_uploads/assetmodels/'.$file->filename))
|
||||||
{{ $file->filename }}
|
{{ $file->filename }}
|
||||||
|
@else
|
||||||
|
<del>{{ $file->filename }}</del>
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td data-value="{{ Storage::size('private_uploads/assetmodels/'.$file->filename) }}">
|
<td data-value="{{ (Storage::exists('private_uploads/assetmodels/'.$file->filename)) ? Storage::size('private_uploads/assetmodels/'.$file->filename) : '' }}">
|
||||||
{{ Helper::formatFilesizeUnits(Storage::size('private_uploads/assetmodels/'.$file->filename)) }}
|
{{ (Storage::exists('private_uploads/assetmodels/'.$file->filename)) ? Helper::formatFilesizeUnits(Storage::size('private_uploads/assetmodels/'.$file->filename)) : '' }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($file->note)
|
@if ($file->note)
|
||||||
|
@ -163,7 +167,7 @@
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($file->filename)
|
@if (($file->filename) && (Storage::exists('private_uploads/assetmodels/'.$file->filename)))
|
||||||
<a href="{{ route('show/modelfile', [$model->id, $file->id]) }}" class="btn btn-default">
|
<a href="{{ route('show/modelfile', [$model->id, $file->id]) }}" class="btn btn-default">
|
||||||
<i class="fas fa-download" aria-hidden="true"></i>
|
<i class="fas fa-download" aria-hidden="true"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue