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
BC break in 2.11 when importing macros inside an embed #3045
Comments
It worked by chance (and was not documented). Making it work with the new implementation is quite impossible. I've just tried. You can either move the |
Alright, that's understandable. Would it be possible to catch this during linting instead? |
@pontus-mp That might be possible to catch this situation with the AST, but I don't think this is worth it. That would be (I think) quite a huge work. |
Okay, in that case the only thing I can think of is a line or two of documentation that this behavior no longer works. We assumed that imports were scoped in blocks similarly to "curly brace"-scopes in programming languages, so others might have done the same thing. |
see #3050 |
Imports are no longer in scope inside nested blocks within embeds.
Example: https://twigfiddle.com/fhfwr0
The block "inner" causes it to fail. The example works fine before Twig 2.11.
The text was updated successfully, but these errors were encountered: