-
Notifications
You must be signed in to change notification settings - Fork 256
2716241 Registration on login pane #380
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
2716241 Registration on login pane #380
Conversation
| $this->credentialsCheckFlood = $credentials_check_flood; | ||
| $this->currentUser = $current_user; | ||
| $this->entityTypeManager = $entity_type_manager; | ||
| $this->entityManager = $entity_manager; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why inject the deprecated entityManager when you already have the non-deprecated entityTypeManager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change this, after I created this, I worked on an issue about the same in core.. But I forgot I used it here.
|
Thanks for getting this rolling! The embedding of the entire existing registration form looks a bit messy, it would probably be better to copy over the AccountForm / RegistrationForm logic (but without the "needs admin approval" and the pass reset / preferred language stuff) |
|
Bojanz: I wanted to do that, but I feel that that would not be the correct way to go. What if extra other modules modify the registration form? We would then make it impossible to use them? Or am I missing something? |
|
Also, If we keep it in one form, and we would add required fields, they would become part of the same js validation (tried this first), when you then would submit the login form, you would be blocked by the registration fields. |
|
Both of these dilemmas are the same as for login. You don't mark any field as required, then validate the fields if one of them was provided. |
|
@bojanz, if we do modify, then I assume the following fields are enough (no timezone etc,...): |
|
We do need an option to auto generate the username i think, as email + username is not user friendly. |
c0f4538 to
5867fef
Compare
|
@bojanz, updated the PR, waiting for feedback. |
| '#description' => $this->t('A valid email address. All emails from the system will be sent to this address. The email address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by email.'), | ||
| '#required' => FALSE, | ||
| ); | ||
| $pane_form['register']['pass'] = array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long array usage.
|
I'm working on this. |
| $cart_link->click(); | ||
| $this->submitForm([], 'Checkout'); | ||
| $this->assertSession()->pageTextContains('Create new account'); | ||
| $this->submitForm([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also test validation? Existing email, invalid email
|
I think I have covered all the validations now. |
76f3e08 to
03472b4
Compare

This is a proposal to have the registration form available on the login step.
I added an extra option to the pane config, so that the site builder can still choose not to show the form.
I also added the user_login hook, to redirect after the actual registration.