From e92cfceea48b6530905740973abd82ab798fe3af Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Mon, 24 Jul 2017 19:53:56 +0200 Subject: [PATCH] Some extra safeguards against exceptions in "strict" mode. --- base-2016/partials/_sub_field_blocks.twig | 4 ++-- skeleton/partials/_sub_field_blocks.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base-2016/partials/_sub_field_blocks.twig b/base-2016/partials/_sub_field_blocks.twig index a56280f..5684e5e 100644 --- a/base-2016/partials/_sub_field_blocks.twig +++ b/base-2016/partials/_sub_field_blocks.twig @@ -41,7 +41,7 @@ {% endif %} {# Image fields #} - {% if fieldtype == "image" %} + {% if fieldtype == "image" and value.file|default is not empty %} {{ popup(value, 1200, 0) }} {% endif %} @@ -58,7 +58,7 @@ {% block extended_fields %} {# Geolocation field #} - {% if fieldtype == "geolocation" and value.latitude is defined %} + {% if fieldtype == "geolocation" and value.latitude|default is not empty %} {% endif %} diff --git a/skeleton/partials/_sub_field_blocks.twig b/skeleton/partials/_sub_field_blocks.twig index 6f0eb28..edbcd88 100644 --- a/skeleton/partials/_sub_field_blocks.twig +++ b/skeleton/partials/_sub_field_blocks.twig @@ -41,7 +41,7 @@ {% endif %} {# Image fields #} - {% if fieldtype == "image" and value['file'] is not empty %} + {% if fieldtype == "image" and value.file|default is not empty %} {{ value|showimage('684') }} {% endif %} @@ -58,7 +58,7 @@ {% block extended_fields %} {# Geolocation field #} - {% if fieldtype == "geolocation" and value.latitude is defined %} + {% if fieldtype == "geolocation" and value.latitude|default is not empty %} {% endif %}