Skip to content

Commit

Permalink
Fix compatibility with PHP 8.1 in base_show_field.html.twig
Browse files Browse the repository at this point in the history
Fixes Twig\Error\RuntimeError: nl2br(): Passing null to parameter #1 ($string) of type string is deprecated
  • Loading branch information
javer authored and franmomu committed Nov 26, 2021
1 parent ae007ef commit 8173cdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resources/views/CRUD/base_show_field.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ file that was distributed with this source code.
data-readmore-more="{{ collapse.more|default('read_more')|trans({}, 'SonataAdminBundle') }}"
data-readmore-less="{{ collapse.less|default('read_less')|trans({}, 'SonataAdminBundle') }}">
{% block field_value %}
{% if field_description.option('safe', false) %}{{ value|raw }}{% else %}{{ value|nl2br }}{% endif %}
{% if field_description.option('safe', false) %}{{ value|raw }}{% else %}{{ value|default('')|nl2br }}{% endif %}
{% endblock %}
</div>
{% else %}
Expand Down

0 comments on commit 8173cdb

Please sign in to comment.