Fix display bug for attachments

This commit is contained in:
James Cole
2016-09-20 17:23:12 +02:00
parent 1cfe4f40ba
commit e169754693
2 changed files with 6 additions and 6 deletions

View File

@@ -104,7 +104,7 @@ class Attachment extends Model
*/ */
public function getDescriptionAttribute($value) public function getDescriptionAttribute($value)
{ {
if (is_null($value)) { if (is_null($value) || strlen($value) === 0) {
return null; return null;
} }
@@ -118,7 +118,7 @@ class Attachment extends Model
*/ */
public function getFilenameAttribute($value) public function getFilenameAttribute($value)
{ {
if (is_null($value)) { if (is_null($value) || strlen($value) === 0) {
return null; return null;
} }
@@ -132,7 +132,7 @@ class Attachment extends Model
*/ */
public function getMimeAttribute($value) public function getMimeAttribute($value)
{ {
if (is_null($value)) { if (is_null($value) || strlen($value) === 0) {
return null; return null;
} }
@@ -147,7 +147,7 @@ class Attachment extends Model
*/ */
public function getNotesAttribute($value) public function getNotesAttribute($value)
{ {
if (is_null($value)) { if (is_null($value) || strlen($value) === 0) {
return null; return null;
} }
@@ -162,7 +162,7 @@ class Attachment extends Model
*/ */
public function getTitleAttribute($value) public function getTitleAttribute($value)
{ {
if (is_null($value)) { if (is_null($value) || strlen($value) === 0) {
return null; return null;
} }

View File

@@ -161,7 +161,7 @@
<td> <td>
<i class="fa {{ att.mime|mimeIcon }}"></i> <i class="fa {{ att.mime|mimeIcon }}"></i>
<a href="{{ route('attachments.download', att.id) }}" title="{{ att.filename }}"> <a href="{{ route('attachments.download', att.id) }}" title="{{ att.filename }}">
{% if att.title|length > 0 %} {% if att.title %}
{{ att.title }} {{ att.title }}
{% else %} {% else %}
{{ att.filename }} {{ att.filename }}