Closed (duplicate)
Project:
Ubercart
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2009 at 08:22 UTC
Updated:
6 Oct 2011 at 17:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rszrama commentedHey Tim, I'm not sure on this one... I just enabled the auto-login for new users on the Livetest and completed an anonymous checkout. It logged me in without warning, and there are no similar errors in the watchdog. I'm wondering what other modules you might have enabled that would affect user registration and creation.
The query you're showing here is for inserting an empty user account into the users table, something that Ubercart doesn't do (at least directly). When anonymous checkout happens, Ubercart builds a user object and runs user_save() on that... so at the very least I'd expect there to be an e-mail in that query.
Comment #2
thill_ commentedI can't repeat on any other install, will mark fixed to get it off the list.
Comment #4
vood002 commentedI'm receiving this error. Ubercart RC6 and Drupal 6.14.
I'm getting it on every anonymous checkout. Is there any other information I can provide?
Comment #5
vood002 commentedThis problem was being caused, for me, by a conditional action that set the order to "completed" as soon as payment was received. Apparently this caused some things to go out of order and awry.
Comment #6
Anonymous (not verified) commentedI have this problem as well. Any anonymous checkout results in an error message like the following:
user warning: Duplicate entry '' for key 2 query: INSERT INTO users (created) VALUES (1266467414) in /var/www/vhosts/xxx.com.au/httpdocs/modules/user/user.module on line 327.
I tried #5 and this does not fix it. Even if removing that conditional action did work, it would not be a good solution.
Any ideas?
Comment #7
pcorbett commentedSame issue but with newer version of ubercart and Drupal 6.15. Any anonymous checkout results in a similar error message. Interestingly, everything seems to go through. I'm using this for role/membership creation and the user is created with the order posting to PayPal and the user receiving a password email -- login works and order is recorded.
(URL obfuscated for privacy purposes)
Referrer: https://xxx.com/cart/checkout/review
Message Duplicate entry '' for key 2 query: INSERT INTO users (created) VALUES (1266505207) in /var/www/xxx.com/modules/user/user.module on line 327.
Comment #8
pcorbett commentedUpdate: I debugged uc_roles_grant() and $account is not set correctly upon order submit:
Comment #9
gooddesignusa commentedkeeping an eye on this one
Comment #10
Anonymous (not verified) commentedThis is also being discussed over at http://www.ubercart.org/issue/13192/new_user_creation_checkout_and_autom...
Comment #11
gooddesignusa commentedseems like a show stopper. hope this gets fixed soon.
Comment #12
valante commentedSame with Drupal 6.17, Ubercart 6.x-2.3 . This one's killing me.
Comment #13
YK85 commentedsubscribing
Comment #14
mickyb commentedOk I've found this particular bug and I was able to fix it. The issue here is that the conditional actions that assign the roles to users try to run against the 'anonymous' user account first, then they run against the newly created user. This was causing the errors, since the 'anonymous' user doesn't have any data in it so to speak. So the fix here was simple:
I've attached a patch that will hopefully be useful to everyone here (to be applied to:
ubercart/uc_roles/uc_roles.ca.inc). The issue can probably be solved much deeper in the code, but for my purposes this will suffice.Thanks to "pcorbett" (comment #8) for the head start :)
Whoever tests this first can add [SOLVED] to the issue title once they've verified that it's working for them too.
--Michael
Comment #15
longwaveThis seems to be related to #479836: Roles and File Downloads Not Being Assigned for Anonymous Checkouts and #426914: Default Renew triggers should contain additional check
Comment #16
longwaveShould be fixed now the whole anonymous checkout/duplicate emails/roles thing is all sorted in -dev.