-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
On login page, register form gets embedded in base layout (resulting in two nested base layout) #412
Comments
Fixing sonata-project#412 and an issue with `security.context` having a _null_ token
+1 |
1 similar comment
👍 |
I updated my base_login.html.twig but still facing the issue. My current template is located in {% extends "TwigBundle::layout.html.twig" %}
{% block body %}
{{ block('fos_user_content') }}
{% endblock %} Any idea? |
I could narrow down my issue to the FOS User Bundle register view. Original view **register.html.twig'': {% extends "FOSUserBundle::layout.html.twig" %}
{% block fos_user_content %}
{% include "FOSUserBundle:Registration:register_content.html.twig" %}
{% endblock fos_user_content %} Removing the layout extension: {#{% extends "FOSUserBundle::layout.html.twig" %}#}
{% block fos_user_content %}
{% include "FOSUserBundle:Registration:register_content.html.twig" %}
{% endblock fos_user_content %} Is this an FOS issue? |
@stof Do you have an idea? |
that will break if you don't fill the register form properly. thanks |
I was struggling with the same issue. To fix it, I did override the problematic template with the following one:
With the same content as in the original one, without extending any layout: {% block fos_user_content %}
{% include "FOSUserBundle:Registration:register_content.html.twig" %}
{% endblock fos_user_content %} Did the trick for me! |
Fixing sonata-project#412 and an issue with `security.context` having a _null_ token with "non-standard" security.yml configuration the login/register page could be behind no firewall, implying there won't be any token from the security.context service
That's not the solution because if you do not modify the /register controller or layout, that page will result in a no-layout registration form. Another solution is to modify the controller being executed for your own:
Then just render the same template as |
This issue is very old. Can you please check this against the latest stable / master version? Feel free to reopen, if the error still exists. A PR would be welcome if you reopen this issue. |
While trying to figure why my login page would have two nested base layouts, I narrowed it down to
SonataUserBundle / Resources / views / Security / base_login.html.twig
, which calls:But then the controller renders the form by calling:
which uses
{% extends "FOSUserBundle::layout.html.twig" %}
...... resulting in nested base layouts...
Am I missing something or is there a bug somewhere?
The text was updated successfully, but these errors were encountered: