getgrav / grav-plugin-login

Grav Login Plugin
http://getgrav.org
MIT License
44 stars 54 forks source link

Issue Creating User With Multiple Languages Enabled #216

Open pjkaufman opened 5 years ago

pjkaufman commented 5 years ago

I have been looking into working with this plugin for a multilingual site, but I have been unable to register a new user while multiple languages are enable in the system.yaml file. I have checked to see if logs\grav.log has logged any errors, but it does not have any errors logged. I am using the admin grav site v.1.6.11 and the current versions of all plugins that come with it.

Is this supposed to happen or is this bug? Thank you for your help!

lufog commented 5 years ago

On my multi-language site, registration works properly. Maybe in beta it was fixed...


Grav v1.7.0-beta.4 Login v3.0.3

pjkaufman commented 5 years ago

@lufog Are you using the default registration form? I am using the default registration form with Grav v.1.6.11 Login v3.0.3

I have tried to run the registration with a clean installation of the grav admin and core as well as the one I am using. It has worked with both as long as the multi-language support was turned off. As soon as I turned on the multi-language support neither worked. I do not know if I need to modify the login.yaml file after turning on the multi-language aspect of the site.

lufog commented 5 years ago

@pjkaufman I understood why this error does not occur to me. My site uses a self-developed theme that overrides many system layouts. On any theme using the templates\forms\form.html.twig from form plugin, my registration also stops working.


Problem in line (20):

{% set action = url(form.action ?: page.route ~ uri.params) %}

It does not consider language in action, gives /register instead /en/register.

lufog commented 5 years ago

For fast fix replace line 20 in: user\plugins\form\templates\forms\default\form.html.twig from:

{% set action = url(form.action ?: page.route ~ uri.params) %}

to

{% set action = base_url ~ form.action ?: page.route ~ uri.params %}
pjkaufman commented 5 years ago

@lufog Thank you! Your suggested fix fixes the issue that I have run into.

mahagr commented 5 years ago

Duplicate of https://github.com/getgrav/grav-plugin-form/issues/355

And it's already fixed in forms plugin. Thanks for reporting it, though!

mahagr commented 5 years ago

Oh, and there's a slight issue in the proposed fix, it should be either the old behavior:

{% set action = form.action ? base_url ~ form.action : base_url ~ page.route ~ uri.params %}

or rather the new behavior (which also allows external urls as the previous broken fix): https://github.com/getgrav/grav-plugin-form/commit/fdaf6e056482e8e724447ecb1b16d6826f660be4

lefloresg commented 5 years ago

I had opened another issue but I think it makes sense to follow-up here. I've been looking over the issue record and attempted to make the changes for a Form. I'm not getting the email, it is not saving the information to the /data folder, nor going to the thankyou page. I'm not sure what's going on. I've gone onto the discourse page and here and I can't seem to get it to work. Any help would be appreciated. Thanks!

hexplor commented 5 years ago

I have the same issue as @lefloresg . This update ruined all my contact forms and latest fixes didn't help. I will try to investigate what's wrong...