I am receiving this error when creating a user without an access code. If I create a user with an access code then there is no error.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'PRIMARY': INSERT INTO {access_code} (uid, code, expiration) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 25 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => 1390366799 ) in access_code_user_insert() (line 215 of /sites/all/modules/access_code/access_code.module).
Any ideas?
thanks
Comments
Comment #1
rudy2342 commentedI add this before the db_insert on line 208. Seems to working fine now. Curious to see if anyone else had this issue.
if(!empty($account->access_code)){Comment #2
hyperlinkedI've incorporated this into my patch against issue #2265509:
https://drupal.org/node/2265509
You can apply that patch to fix this. I've also added a uniqueness check to the validation function so you won't get this same error if you accidentally used the same code twice.
Comment #3
hyperlinkedComment #5
glekli commentedThis issue has been addressed.
Comment #6
hyperlinkedVerified. Closed.