sonata-project / SonataUserBundle

Symfony SonataUserBundle
https://docs.sonata-project.org/projects/SonataUserBundle
MIT License
342 stars 487 forks source link

Styles are not available in SonataUserBundle #608

Closed ltarasiewicz closed 7 years ago

ltarasiewicz commented 9 years ago

Hello,

I've configured SonataUserBundle together with SonataAdminBundle. I now have access to URLs like /login, /register, /profile. This is how the login page looks like. Other pages also do not have any styles loaded.

Does Sonata provide any default styles for these pages. I though that maybe I have a problem with dependency version. This is 'Sonata' fragment of my composer.json:

"sonata-project/admin-bundle": "~2.3",
"sonata-project/doctrine-orm-admin-bundle": "^2.3",
"sonata-project/easy-extends-bundle": "^2.1",
"sonata-project/user-bundle": "^2.2",
"knplabs/knp-menu": "~1.1",
"knplabs/knp-menu-bundle": "~1.1",
"sonata-project/core-bundle": "~2.3"

I've also installed the assets with php app/console assets:install web --symlink, cleared the cache with php app/console cache:clear.

When I inspect the 'Network' tab in the Chrome Dev tools, no asset files are ever attempted to be loaded.

ToBe998 commented 9 years ago

Any news here? I tried almost every combination of bundle versions now without any luck. It seems the layout templates are wrong. The template used by default does not have a proper html/head/body tag and I could not find any applicable replacement for it.

Broken template (I suppose the other templates outside the AdminBundl itself are broken to):

SonataUserBundle:Security/base_login.html.twig

Default layout without proper html or body tag (probably intended to be used inside something else:

SonataUserBundle:layout.html.twig

Possible replacements from AdminBundle (dont work because we dont have a admin_pool):

SonataAdminBundle:empty_layout.html.twig
SonataAdminBundle:standard_layout.html.twig

Possible replacement from FOS (does not provide any styles but at least has a proper html/body tag):

FOSUserBundle:layout.html.twig

So, how should this work? Is there any fix for that?

redactuk commented 8 years ago

I have same issues. Did you find solution?

ToBe998 commented 8 years ago

I was forced to use the stand-alone version of SonataUserBundle. Sadly it seems the FOS based version does no longer work with current block templates. I disabled all routes that didnt work and added these two:

sonata_user:
    resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
    prefix: /admin

# Fix for missing and disfunctional route "sonata_user_profile_show"
sonata_user_profile_show:
    path: /admin/dashboard
jordisala1991 commented 7 years ago

Old issue for 2.x branch. I will reopen it if this is still happening with 3.x