I recently did a vendors/install and now my sonata admin is broken with the following error:
Item “roles” for “” does not exist in SonataAdminBundle::standard_layout.html.twig at line 92
Here is the twig code:
{% if app.security %}
{% for role in app.security.token.roles %}
{% if not allowed %}
{% set allowed = role.role == 'ROLE_SONATA_ADMIN' %}
{% endif %}
{% endfor %}
{% endif %}
Anyone have any thoughts?
Thanks!
I searched through admin bundle with blame option and it comes from a commit 7 days ago
So what you have to do is go to deps.lock
Find the adminBundle commit hash(In my case it started with 4a….)
replace the hash with 25b401e6271ee0fd896d700d0328b06994e4e138 which is commit before the commit that cause problem
I tried it and dashboard works correctly
Good luck
EDIT
Be careful not to use php bin/vendor update since it will update the commit hash
Use php bin/vendor install