-
Notifications
You must be signed in to change notification settings - Fork 274
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
TwigException "Unexpected end of object" when re-render compiled template #901
Comments
Are you able to simplify this to a minimal example that still causes the error? |
After studying the problem, it turned out that the error occurs when trying to use a variable with a value of 0 as a map key. The class is the same as in the starting topic. Test function:
Short test pattern causing problem on 2nd run:
Dump result when running the test function for the first time:
Render result when running the test function for the first time:
Dump result when running the test function for the second time:
Render result when running the test function for the second time:
If you don't use 0 it works:
Dump result for any number of runs:
Render result for any number of runs:
There is no error, but the key values are not taken from the variables:
Dump result for any number of runs:
This works for any number of runs:
This works for any number of runs, but the key type is "string":
This causes an error on the second run:
Results as in example 1.
Dump result:
|
I have template and run "test" function 2 times. First time it work, second time i have TwigException "Unexpected end of object". What i doing wrong?
Test function:
My class:
My template:
The text was updated successfully, but these errors were encountered: