mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 22:19:41 -08:00
Merge pull request #11836 from snipe/fixes/500_if_image_is_missing
Fixed 500 error if uploaded file is missing from asset view
This commit is contained in:
commit
0f777b3168
|
@ -1198,10 +1198,14 @@
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@if (Storage::exists('private_uploads/assets/'.$file->filename))
|
||||||
{{ $file->filename }}
|
{{ $file->filename }}
|
||||||
|
@else
|
||||||
|
<del>{{ $file->filename }}</del>
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td data-value="{{ @Storage::size('private_uploads/assets/'.$file->filename) }}">
|
<td data-value="{{ (Storage::exists('private_uploads/assets/'.$file->filename) ? Storage::size('private_uploads/assets/'.$file->filename) : '') }}">
|
||||||
{{ @Helper::formatFilesizeUnits(Storage::size('private_uploads/assets/'.$file->filename)) }}
|
{{ @Helper::formatFilesizeUnits(Storage::exists('private_uploads/assets/'.$file->filename) ? Storage::size('private_uploads/assets/'.$file->filename) : '') }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($file->note)
|
@if ($file->note)
|
||||||
|
@ -1209,7 +1213,7 @@
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($file->filename)
|
@if (($file->filename) && (Storage::exists('private_uploads/assets/'.$file->filename)))
|
||||||
<a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default">
|
<a href="{{ route('show/assetfile', [$asset->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>
|
||||||
|
@ -1291,10 +1295,14 @@
|
||||||
@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)) }}
|
{{ Helper::formatFilesizeUnits(@Storage::size('private_uploads/assetmodels/'.$file->filename)) }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($file->note)
|
@if ($file->note)
|
||||||
|
@ -1302,7 +1310,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', [$asset->model->id, $file->id]) }}" class="btn btn-default">
|
<a href="{{ route('show/modelfile', [$asset->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