hello,
we are running ubercart 7.x-3.6. i do not have any login/auth modules installed, except for the SMTP auth module (which would seem completely unrelated). we allow anonymous checkout.
an anonymous user can add items to their cart, and checkout anonymously fine. but if they add items to their cart, and then log in before checking out,. they lose all their cart contents.
i have seen this issue mentioned on earlier versions of drupal/ubercart, but none of those solutions seem to apply to us, and i have not found this issue for drupal7/ubercart3. i did not see it in this list of issues.
it would appear to be a session issue, but without debugging the code i am not sure how to fix it. is this a known issue? is there a workaround or fix? or do i need to hack some core code to make it work?
thanks for any thoughts or guidance.
Comments
Comment #1
longwaveNo, this is not a known issue, in fact we have automated tests which cover this scenario to ensure that it does work on an out of the box install of Ubercart. SMTP authentication would seem to be unrelated as you say.
uc_cart_user_login() and the subsequent call to uc_cart_login_update() are responsible for merging the anonymous cart with the authenticated cart, you should start any debugging investigations there.
Comment #2
longwaveDidn't mean to change priority.
Comment #3
laz0rama CreditAttribution: laz0rama commentedthanks longwave, i will start my research there.
Comment #4
laz0rama CreditAttribution: laz0rama commentedthanks indeed. initial debugging has determined that hook_user_login is not being called, either on uc_cart or on my own custom module. i will look into what might be causing that.
Comment #5
laz0rama CreditAttribution: laz0rama commentedwow, from what i can tell, the only module whose hook_user_login() hook is actually getting called is system (system_user_login). not even the hook_user_login() in user.api.php! i imagine there is some module conflict at play. uggg....
Comment #6
laz0rama CreditAttribution: laz0rama commentedok, i figured it out. there was an action (triggered by login) sending the user to the site's home page upon login. much of what i read in researching this said that if any module did a redirect (in hook_user_login), then additional hook_user_logins would not fire (which totally makes sense, since the drupal_goto() or whatever would be immediate). although no modules i could find was doing any redirect, i thought to check the actions/rules/triggers. and sure enough...
issue resolved.
thanks again to longwave for setting me in the right direction to figure it out.
Comment #7
longwaveGlad to help.
Also note that user.api.php (and all other *.api.php files) is for documentation only, and will never be executed.