Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid twig deprecation warning #910

Closed
wants to merge 1 commit into from
Closed

Avoid twig deprecation warning #910

wants to merge 1 commit into from

Conversation

silvioq
Copy link
Contributor

@silvioq silvioq commented Oct 25, 2018

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

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
@lcharette
Copy link
Member

Not sure why the _modal_footer  exist? Could we simply do :

            {% if block('modal_footer') is defined %}
                <div class="modal-footer">
                    {{ block('modal_footer') | raw }}
                </div>
            {% endif %}
``` 

In any case, not why why the `default` is necessary. There's already an `if not empty` above it.

@lcharette lcharette added compatibility Compatibility issue with other framework, features templating Related to the template feature labels Oct 25, 2018
@lcharette lcharette added this to the 4.1.x milestone Oct 25, 2018
@silvioq
Copy link
Contributor Author

silvioq commented Oct 25, 2018

@lcharette , your solution is better, I will change my PR.

@silvioq
Copy link
Contributor Author

silvioq commented Oct 25, 2018

I created PR #911 ... you can close this Pull request.

@lcharette
Copy link
Member

I created PR #911 ... you can close this Pull request.

FYI, you can add more commits to your fork to continue on the same PR, for futures one. Might be different if you post directly from GitHub...

@lcharette lcharette closed this Oct 25, 2018
@silvioq silvioq deleted the patch-1 branch October 25, 2018 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility issue with other framework, features templating Related to the template feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants