php - Symfony 2.8 Twig_Error_Runtime Sonata Admin Bundle -
twig_error_runtime: exception has been thrown during rendering of template ("the "app.security" variable not available.") in sonataadminbundle::standard_layout.html.twig @ line 183.
now did not think possible, app being twig global, , have no idea start. trying configure sonata user bundle: fos user bundle , sonata admin bundle little success.
edit removed sonatauserbundle , went configuration know worked in other projects. isolated problem being symfony , twig specific rather error in configuration; have removed config files.
for else hits problem: app.security deprecated 2.6 , supposed removed in 3.0. has broken bc layer , container not injected more effect app.security has been removed in 2.8 , not in 3.0. see https://github.com/symfony/symfony/issues/18223 , https://github.com/symfony/symfony/commit/bf066dace2922cf1ce335f5f683fc63d5a7e23c2. don't know if or when fixed.
meanwhile solution override sonataadminbundle::standard_layout.html.twig , remove calls app.security per migration 3.0 instructions: http://symfony.com/blog/new-in-symfony-2-6-security-component-improvements
lastly, change deprecates app.security global variable twig templates. should use instead app.user global variable , is_granted() function.
this bug in twig bridge may fixed @ date: https://github.com/symfony/symfony/issues/18223 https://github.com/symfony/symfony/commit/bf066dace2922cf1ce335f5f683fc63d5a7e23c2
meanwhile solution override sonataadminbundle::standard_layout.html.twig , replace calls app.security app.user per migration 3.0 instructions: http://symfony.com/blog/new-in-symfony-2-6-security-component-improvements
Comments
Post a Comment