-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Macro arguments using leading/tailing underscore (BC introduced in v3.15) #4452
Comments
@fabpot what was the reason to trim |
File ....Okay! This explanation has clarified my issue. The compiled template looks much cleaner without the I think the reason for |
Hello. I have an error too when I upgraded 3.14.2 to 3.15
Like the missing variable is $_v0 with an underscore, I think is may be in relation with this issue. It seems to appear with |trans filter. |
#4475 should fix this issue |
Hi. I discovered a side effect after upgrading to the latest version, related to this line in PR 4391.
For me, it's a BC, which may affect others as well.
The usage of macro arguments having leading/tailing underscores worked well until 3.15.
Example:
Output:
3.14:
The message: 'Hello World!'.
3.15:
The message: ''.
Compiled template:
In the referred line of the PR, underscores are trimmed off from arguments as they are assigned onto
$context
._message
becomesmessage
, but the original_message
is requested in theescape
-method later. That's an error.I'm curious how I should see the code change. If this is the intention, maybe a
trigger_deprecation
should be called while evaluating the macro arguments.I just wanted to let you know - the affected templates will be fixed on my side.
The text was updated successfully, but these errors were encountered: