Open pdugas opened 6 years ago
Getting the same issue with app.user
which appears to be null but if I pass in $this->getUser()
from the controller and use that instead of app.user
, things work as expected. Something's hosed with Twig in this setup still.
And another... Trying to add EasyAdminBundle. Had to patch around Doctrine's FileCache failing if the cache folder isn't writeable even though it's not trying to write to it javiereguiluz/EasyAdminBundle#1954 then ran into what I'm guessing is this Twig issue again.
request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Could not parse property path "[entities][]". Unexpected token "[" at position 10")." at /base/data/home/apps/p~xxx/staging.xxx/vendor/javiereguiluz/easyadmin-bundle/src/Resources/views/default/list.html.twig line 1 {"exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"Could not parse property path \"[entities][]\". Unexpected token \"[\" at position 10\"). at /base/data/home/apps/p~xxx/staging.xxx/vendor/javiereguiluz/easyadmin-bundle/src/Resources/views/default/list.html.twig:1, Symfony\\Component\\PropertyAccess\\Exception\\InvalidPropertyPathException(code: 0): Could not parse property path \"[entities][]\". Unexpected token \"[\" at position 10 at /base/data/home/apps/p~xxx/staging.xxx/vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/PropertyPath.php:116)"} []
I've reached out to the Symfony folk here https://github.com/symfony/symfony/issues/25368
@pdugas , same here. I've changed :
twig: strict_variables: true
To:
twig: strict_variables: false
and it fixes the issue.
Hope the solution will be found soon...
There appears to be something missing from the modified
Twig\Environment
object. When thecsrf_token()
function is used in a template, I'm getting an error from the baseclass'getRuntime()
method indicating it was unable to loadSymfony\Bridge\Twig\Form\TwigRenderer
. I worked around it by passing the token in from the controller instead of using the function in the template. I tried digging in to see what I could figure out but I'm not following what's going on in that class so I'm not really able to provide any insight into the root cause. Sorry.