Skip to content

Commit

Permalink
Fix twig deprecation (sonata-project#4276)
Browse files Browse the repository at this point in the history
Fixes the deprecation:

```
Silent display of undefined block "form_message" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block('form_message') is defined" expression to test for block existence
```
  • Loading branch information
romainneutron authored and OskarStark committed Jan 18, 2017
1 parent 35d42c5 commit 94a68f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Resources/views/Form/filter_admin_fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ file that was distributed with this source code.
</div>
{% endif %}
{% endfor %}
{{ block('form_message') }}
{% if block('form_message') is defined %}
{{ block('form_message') }}
{% endif %}
{% if expanded %}
</div>
{% endif %}
Expand Down Expand Up @@ -79,7 +81,9 @@ file that was distributed with this source code.
{% endif %}
{% if form.parent != null and 'choice' not in form.parent.vars.block_prefixes %}
</div>
{{ block('form_message') }}
{% if block('form_message') is defined %}
{{ block('form_message') }}
{% endif %}
{% endif %}
{% endspaceless %}
{% endblock checkbox_widget %}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"symfony/twig-bridge": "^2.3.5 || ^3.0",
"symfony/validator": "^2.3 || ^3.0",
"twig/extensions": "^1.0",
"twig/twig": "^1.26"
"twig/twig": "^1.28"
},
"require-dev": {
"jms/di-extra-bundle": "^1.7",
Expand Down

0 comments on commit 94a68f9

Please sign in to comment.