Skip to content

Commit 3cf31ce

Browse files
authored
Avoid twig deprecation warning
Using "is defined" for prevent twig deprecation message: `Silent display of undefined block "modal_footer" in template "modals/modal.html.twig" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block('modal_footer') is defined" expression to test for block existence` twigphp/Twig@ae9b503
1 parent 95ad1f6 commit 3cf31ce

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

app/sprinkles/core/templates/modals/modal.html.twig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{# Base layout for modals.
22
#}
33

4-
{# Conditional block. See http://stackoverflow.com/a/13806784/2970321 #}
5-
{% set _modal_footer = block('modal_footer') %}
6-
74
<div class="modal fade" role="dialog">
85
<div class="modal-dialog {% block modal_size %}{% endblock %}" role="document">
96
<div class="modal-content">
@@ -17,9 +14,9 @@
1714
{% block modal_body %}
1815
{% endblock %}
1916
</div>
20-
{% if _modal_footer is not empty %}
17+
{% if block('modal_footer') is defined %}
2118
<div class="modal-footer">
22-
{{ _modal_footer | raw }}
19+
{{ block('modal_footer') | raw }}
2320
</div>
2421
{% endif %}
2522
</div>

0 commit comments

Comments
 (0)