Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Rules integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2013 at 12:03 UTC
Updated:
23 Apr 2013 at 04:40 UTC
I have set up store & using addon module commerce_addressfield. Only email ID for creating account is required at the set up. But when I am trying to checkout & expecting it to create user account...it's giving me this error at the end --
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'name': INSERT INTO {users} (uid, created) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 23 [:db_insert_placeholder_1] => 1363433406 ) in drupal_write_record() (line 7106 of$base_url/includes/common.inc).
Comments
Comment #1
rszrama commentedSounds like you're just using the same or similar e-mail address for two anonymous users. We should add checking to commerce_order_get_properties() to make sure it doesn't use an existing username.
Comment #2
rszrama commentedActually, looking back at your error message now, it actually looks like you somehow have a blank e-mail address and the duplication is caused by an attempt to insert a new "anonymous" row in the users table. I'd look at your Rule and ensure it's still properly pulling the e-mail address from commerce-order:mail.
In any event, I have just committed a fix to prevent duplicate usernames, which was possible if you used a hyphen in an e-mail address in one case and for another order put a character in that place that gets converted to a hyphen.
Commit: http://drupalcode.org/project/commerce.git/commitdiff/e24335f
Comment #3
rajeevkYeah it's fixed by your help.
Thanks :)