We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Redefining a deferred block that is not the first deferred block of the parent template removes other blocks from rendering.
Here is a test to reproduce the issue :
--TEST-- Failed parents override --TEMPLATE-- {% extends "level1.twig" %} {% block overrided deferred %}{{ parent() }}:level2({{data|join(', ')}}){% endblock %} {% do data.append('lazy2') %} --TEMPLATE(level1.twig)-- {% block bar '[bar]' %} {% block foo deferred %}[foo]{% endblock %} {% block baz '[baz]' %} {% block overrided deferred %}[overrided]{% endblock %} {% block zoo '[zoo]' %} {% do data.append('lazy1') %} --DATA-- return [] --EXPECT-- [bar][foo][baz][overrided]:level2(lazy2, lazy1)[zoo]
This test currently produces this output : [baz][foo][zoo]
[baz][foo][zoo]
This test deliberately adds intermediate blocks to clearly see the abnormal behavior.
Here is a minimal version to reproduce the issue :
--TEST-- Failed parents override simple --TEMPLATE-- {% extends "level1.twig" %} {% block overrided deferred %}{{ parent() }}:level2{% endblock %} --TEMPLATE(level1.twig)-- {% block foo deferred %}[foo]{% endblock %} {% block overrided deferred %}[overrided]{% endblock %} --DATA-- return [] --EXPECT-- [foo][overrided]:level2
This test currently produces : [foo]
[foo]
In both cases, if we swap the foo and overrided blocks in level1.twig, then the expected rendering is correct.
--TEST-- Passed parents override --TEMPLATE-- {% extends "level1.twig" %} {% block overrided deferred %}{{ parent() }}:level2({{data|join(', ')}}){% endblock %} {% do data.append('lazy2') %} --TEMPLATE(level1.twig)-- {% block bar '[bar]' %} {% block overrided deferred %}[overrided]{% endblock %} {% block baz '[baz]' %} {% block foo deferred %}[foo]{% endblock %} {% block zoo '[zoo]' %} {% do data.append('lazy1') %} --DATA-- return [] --EXPECT-- [bar][overrided]:level2(lazy2, lazy1)[baz][foo][zoo]
--TEST-- Passed parents override simple --TEMPLATE-- {% extends "level1.twig" %} {% block overrided deferred %}{{ parent() }}:level2{% endblock %} --TEMPLATE(level1.twig)-- {% block overrided deferred %}[overrided]{% endblock %} {% block foo deferred %}[foo]{% endblock %} --DATA-- return [] --EXPECT-- [overrided]:level2[foo]
For my part, I have not yet managed to find the cause of the bug. You will undoubtedly be more efficient.
The text was updated successfully, but these errors were encountered:
Fix overridden blocks are not rendered
063f450
See #17.
Hey @TLG-Gildas , thanks for reporting and investigating the issue! I believe it should be fixed by #19.
Sorry, something went wrong.
thanks for the work, unfortunately this doesn't fix the problem, I made a comment in the PR
Fix overridden blocks are not rendered (#19)
3e5d00c
Successfully merging a pull request may close this issue.
Redefining a deferred block that is not the first deferred block of the parent template removes other blocks from rendering.
Here is a test to reproduce the issue :
This test currently produces this output :
[baz][foo][zoo]
This test deliberately adds intermediate blocks to clearly see the abnormal behavior.
Here is a minimal version to reproduce the issue :
This test currently produces :
[foo]
In both cases, if we swap the foo and overrided blocks in level1.twig, then the expected rendering is correct.
For my part, I have not yet managed to find the cause of the bug.
You will undoubtedly be more efficient.
The text was updated successfully, but these errors were encountered: