]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix error when withRemove variable is not defined. 3573/head
authorStéphane HULARD <s.hulard@chstudio.fr>
Tue, 23 Jan 2018 17:48:52 +0000 (18:48 +0100)
committerStéphane HULARD <s.hulard@chstudio.fr>
Tue, 23 Jan 2018 17:51:52 +0000 (18:51 +0100)
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.

src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_tags.html.twig

index 1317b1295a2038d63c29f1b91f9f7d746a8e51fe..73998b58def4cde5d1374658c72a0b0fdd56050b 100644 (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>