[CRM-9091] Fatal error occurs when account registration matches a contact with an existing account Created: 25/Oct/11 Updated: 02/Jun/16 Resolved: 19/Oct/15
|Affects Version/s:||3.3.6, 3.4.alpha, 3.4.beta, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.4.6, 3.4.7, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.6, 4.0.7|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Funding Source:||Needs Funding|
We have identified this issue in 3.3.5 and the current drupal demo site.
The general problem is - if when creating a drupal registration, the registration information provided matches a contact record that already has an associated drupal account, a fatal DB error occurs.
I reproduced this on the current demo site as follows
1 - find a contact with 2 email addresses
Here is the error I received
Database Error Code: Duplicate entry '27-1' for key 3, 1062
[code] => -5
Here is the backtrace
We are seeing this issue with clients that have contacts will multiple emails. The individual generally has a personal email and an organization related email.
It seems that there are few options for handling this
1 - change the database constraint to allow the 2 account to be linked to the contact (there is probably some downside to this but none immediately come to mind)
The only issue I see with option 2 is that we see a lot of environments where site use is sporadic (only once or twice a year) if the original email on the account is no longer valid there is no way for the user to correct it, so creating a second account is the only solution.
I think sim
|Comment by Donald A. Lobo [ 28/Oct/11 ]|
|Comment by Dave Schafer [ 28/Oct/11 ]|
Our clients struggle continually with users creating duplicate contacts through various means, this is creating yet another opportunity for that to happen.
In most cases we expose a lot of contact information via profiles and it could cause a lot of duplication and or support calls if all of a sudden it appeared that a users information was gone. (most user won't realize it is a new account / contact)
I think it would be preferable to prevent the creation of the new account. The use could receive the message:
"Sorry, this account cannot be created. The email address <insert new address here> is associated with a contact that has an existing account"
|Comment by Donald A. Lobo [ 28/Oct/11 ]|
I did the fix at a lower level which might be called when synching contacts / login (if accounts were created before civi was installed etc). So I do think the fix makes sense where it is.
Having a formRule that checks the condition and prevents the above case from happening is potentially a good solution. I took a quick look at the code and the fix is probably a bit more involved than what i patched. We can discuss when we chat next week.
|Comment by Jamie Novick [ 11/May/12 ]|
Although not the same issue this is possibly linked:
On one of our implementations Civi generates a DB error when a new user signs up through drupal to make a donation or personal campaign page (possibly in other scenarios) and where the email address used is already used by 2 or more contacts in CiviCRM. The system tries to link both of the contacts to the drupal user and an error is shown when the second link is unable to be made, then forces people to return to the home screen.
Has anyone else encountered this issue?
Although its not the perfect fix but we are intending to modify our code to:
Any thoughts? Should this be raised as a separate bug? Apprecaite this doesnt help with the additional duplicates issue.
|Comment by Eileen McNaughton [ 19/Oct/15 ]|
I'm going to close this out just because it's so old I suspect it's either resolved or unimportant. Please re-open or create another if you can still reproduce
|Comment by Agileware [ 02/Jun/16 ]|
Suitable to re-open this one? I'll create a new issue if not.
Found this same issue in 4.6.16 through a Profile-based user creation on a Contribution Page - prevented the membership on the same page from being processed fully.
Steps to reproduce:
Results in a PDOException and the membership not being processed. But the contribution has already been processed by then.