User was able to register twice with the same mail Id, admin has to change the email the mail id in one account to delete the duplicate account

Comments

greggles’s picture

Thanks for reporting this bug. It's definitely critical.

However, I was unable to observe the behavior you describe. Here are the steps I did:

1. Created a site at https://simplytest.me/project/email_registration/7.x-1.x
2. Visited the /user/register page and registered a new account with an email
3. Visited the /user/register page and registered a new account with the same email as step 2
4. Visited /admin/people/create as an admin and attempted to create an account with the same email as step 2

Expected results after steps 3 and 4:
An error message or warning without an account being created.

Actual results:
As expected.

Can you clarify how this account was made or how you believe it is caused by email_registration?

pramodganore’s picture

I can also recreate this issue.

However, I am assuming other modules might be hooking in.
Will try to debug and update.

-Pramod

greggles’s picture

Thanks, Pramod - I'm curious, are you testing on the same site as kaizerking or are you trying on a new site?

pramodganore’s picture

@greggles,
This is a different site.

-Pramod

greggles’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

@Pramod - ok, thanks for letting me know. Can you try to repeat the issue on a fresh Drupal 7 site with just email registration and see if its possible? If not, what configuration or code changes are necessary to get it to happen?

Updating status and priority given that there's no specific set of steps to repeat the issue at this time.

pramodganore’s picture

@greggles,
I noticed that your modules works good. I had a custom validation on action element of form instead of the validate element

@kaizerking,
I noticed if you have form alters on action element of the form, (in my case, not directly on validate element of form); the custom validation is executed but all core validations are skipped.

We have a complicated environment with arrys of validations to be executed before the form is submitted. So the debug took time.

-Pramod

pramodganore’s picture

Status: Postponed (maintainer needs more info) » Needs review
pramodganore’s picture

I was not totally sure about moving the status to needs review. Let me know if i had to set it to something else.

greggles’s picture

Status: Needs review » Postponed (maintainer needs more info)

Until there's a clear set of steps to repeat the bug in this module it should be in "needs more info" status.

If we can't get to a clear set of steps, it should be closed as "cannot reproduce."

theladebug’s picture

I've also run into this issue. It seems that pressing register in quick succession will cause multiple registrations with the same email address.

This only occurs with the email registration module enabled. I'm currently troubleshooting to tie down the root cause.

greggles’s picture

Very interesting. If you disable this module does that problem remain? My guess is that it does.

I suggest trying the hide_submit module to fix that issue: https://www.drupal.org/project/hide_submit

theladebug’s picture

Actually, the problem goes away when I disable the module.

We've run into a bunch of namespacing issues with hide submit and other modules so I'm afraid that solution won't work for us. I'm going to keep digging.

theladebug’s picture

Just as an FYI - I suspect this is an interaction between this another contrib module, but I havent narrowed it down to which one yet.

I removed all of our custom code around account creation and still am seeing this issue, although I can't reproduce with only this module, or this module plus a couple of others installed.

greggles’s picture

I tried to duplicate this behavior on a simplytest.me site.

I started a site with email_registration module enabled.
I went to the registration form and clicked the button as fast as I could - only one account was created.
I disabled email_registration.
I went to the registration form and clicked the button as fast as I could - only one account was created.

So...I'm still really not sure how to replicate this issue.

jay-dee-ess’s picture

Have this happening right now.

Register an account with an email address, do not verify it. Then register with the same email address and try to verify it. You now will be locked out of both accounts.

greggles’s picture

I tried following those steps in #15 on a simplytest.me site and when I try to register the second time I get the error:

"The e-mail address greg.knaddison@example.com is already registered. Have you forgotten your password?"

@jay-dee-ess - can you try a sandbox site to confirm if you have this problem on 7.x-1.3?

jay-dee-ess’s picture

@greggles: Apologies. Could not recreate on a sandbox site.

Re-read through the issue and saw this from #6:

if you have form alters on action element of the form [...]; the custom validation is executed but all core validations are skipped.

I re-worked a custom module to properly handle additional form validation. Here's what worked for me:

function YOUR_MODULE_form_user_register_form_alter(&$form, &$form_state) {
	$form['#validate'][] = 'YOUR_MODULE_user_register_form_validate';
}

	function YOUR_MODULE_user_register_form_validate(&$form, &$form_state) {
	  // your validation code
	}
greggles’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I'd forgotten about that part of #6.

So far it seems like this bug is mostly caused by custom code mistakes, so I'm going to close this issue.