From 83d19db884350178d2fa80ba3a0fe8cae5f82f73 Mon Sep 17 00:00:00 2001 From: Vidar Langseid Date: Thu, 31 Oct 2024 12:41:26 +0100 Subject: [PATCH 1/2] Made template for showing image_field in admin-ui more robust --- .../themes/admin/ui/field_type/preview/content_fields.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig index 33070b977a..4d68408cad 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig @@ -447,7 +447,7 @@ {{ 'ezimage.master_dimensions'|trans|desc('Master dimensions') }}: {{ 'ezimage.width_and_height'|trans({'%width%': field.value.width, '%height%': field.value.height})|desc('Width: %width%px height: %height%px') }} - {% if field.value.height != '0' %} + {% if field.value.height != '0' and field.value.height != '' %} {{ 'ezimage.ratio'|trans|desc('Ratio') }}: {{ (field.value.width/field.value.height)|round(2) }} From f039e260a8715b85f05e4cc26977dfd75ed22872 Mon Sep 17 00:00:00 2001 From: Vidar Langseid Date: Tue, 17 Dec 2024 14:49:33 +0100 Subject: [PATCH 2/2] Update src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Paweł Niedzielski --- .../themes/admin/ui/field_type/preview/content_fields.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig index 4d68408cad..2170d93898 100644 --- a/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig @@ -447,7 +447,7 @@ {{ 'ezimage.master_dimensions'|trans|desc('Master dimensions') }}: {{ 'ezimage.width_and_height'|trans({'%width%': field.value.width, '%height%': field.value.height})|desc('Width: %width%px height: %height%px') }} - {% if field.value.height != '0' and field.value.height != '' %} + {% if field.value.height %} {{ 'ezimage.ratio'|trans|desc('Ratio') }}: {{ (field.value.width/field.value.height)|round(2) }}