From 12ff461e489c31c1f1e85e6fbbad7d9f7b532f8d Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 21 Jan 2020 17:20:12 +0300 Subject: [PATCH] fix preview audio file case --- templates/web/common/preview.html.twig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/web/common/preview.html.twig b/templates/web/common/preview.html.twig index 0dba1f0cfd..90898e454c 100644 --- a/templates/web/common/preview.html.twig +++ b/templates/web/common/preview.html.twig @@ -15,7 +15,11 @@ {% set previewHtml5 = null %} -{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') and record.has_preview == true %} +{# first check if type audio and there is no preview , fallback to thumbnail #} + +{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') and record.getType == 'audio' and record.has_preview == false %} + {% set preview_obj = record.get_thumbnail() %} +{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') %} {% set preview_obj = record.get_preview() %} {% else %} {% set preview_obj = record.get_thumbnail() %}