From e169754693055b7b4865eef83b6482e82f7f7861 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 20 Sep 2016 17:23:12 +0200 Subject: [PATCH] Fix display bug for attachments --- app/Models/Attachment.php | 10 +++++----- resources/views/transactions/show.twig | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 3d299e4e0c..81e067afb6 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -104,7 +104,7 @@ class Attachment extends Model */ public function getDescriptionAttribute($value) { - if (is_null($value)) { + if (is_null($value) || strlen($value) === 0) { return null; } @@ -118,7 +118,7 @@ class Attachment extends Model */ public function getFilenameAttribute($value) { - if (is_null($value)) { + if (is_null($value) || strlen($value) === 0) { return null; } @@ -132,7 +132,7 @@ class Attachment extends Model */ public function getMimeAttribute($value) { - if (is_null($value)) { + if (is_null($value) || strlen($value) === 0) { return null; } @@ -147,7 +147,7 @@ class Attachment extends Model */ public function getNotesAttribute($value) { - if (is_null($value)) { + if (is_null($value) || strlen($value) === 0) { return null; } @@ -162,7 +162,7 @@ class Attachment extends Model */ public function getTitleAttribute($value) { - if (is_null($value)) { + if (is_null($value) || strlen($value) === 0) { return null; } diff --git a/resources/views/transactions/show.twig b/resources/views/transactions/show.twig index 13da803c5a..bd78503b9b 100644 --- a/resources/views/transactions/show.twig +++ b/resources/views/transactions/show.twig @@ -161,7 +161,7 @@ - {% if att.title|length > 0 %} + {% if att.title %} {{ att.title }} {% else %} {{ att.filename }}