Fix error when withRemove variable is not defined.

Since the withRemove variable is a template flag, it can be undefined.

In the Entry\Card\_content.html.twig template for example, the withRemove variable is not defined.
This commit is contained in:
Stéphane HULARD 2018-01-23 18:48:52 +01:00
parent f24e9bfab0
commit cc09434ea4
No known key found for this signature in database
GPG key ID: 6E911128BF65AB99

View file

@ -3,7 +3,7 @@
{% for tag in tags %}
<li class="chip">
<a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
{% if withRemove %}
{% if withRemove is defined and withRemove == true %}
<a href="{{ path('remove_tag', { 'entry': entryId, 'tag': tag.id }) }}" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')">
<i class="material-icons vertical-align-middle">delete</i>
</a>