Check if a field type_class is defined before using it.

This make the check consistent with a similar check in this template made further down, and fixes an issue with fields added to the form after the form was built.
This commit is contained in:
Jakub Zalas 2014-12-30 09:48:40 +00:00
parent 4cec9a9e86
commit 1e794ca298

View File

@ -420,7 +420,7 @@
{% else %}
<div class="toggle-icon empty"></div>
{% endif %}
{{ name|default('(no name)') }} {% if data.type is not empty %}[<abbr title="{{ data.type_class }}">{{ data.type }}</abbr>]{% endif %}
{{ name|default('(no name)') }} {% if data.type_class is defined and data.type is defined %}[<abbr title="{{ data.type_class }}">{{ data.type }}</abbr>]{% endif %}
{% if data.errors is defined and data.errors|length > 0 %}
<div class="badge-error">{{ data.errors|length }}</div>
{% endif %}
@ -440,7 +440,7 @@
<div class="tree-details" {% if data.id is defined %} id="{{ data.id }}-details"{% endif %}>
<h2>
{{ name|default('(no name)') }}
{% if data.type_class is defined %}
{% if data.type_class is defined and data.type is defined %}
<span class="form-type">[<abbr title="{{ data.type_class }}">{{ data.type }}</abbr>]</span>
{% endif %}
</h2>