I have both the voucher and organic groups regcode modules activated. Once I activate the voucher module, an exception is generated in the user registration process. The error occurs because voucher implements hook_user_presave. The result is that the code tries to assign the user to the organic group before the user account has been saved to the database.

Solution: implementing hook_user_update instead of hook_user_presave fixes the issue for me. I no longer receive an error, and the voucher code is used successfully on update. Patch is attached. Let me know if you have any questions. Thanks!

CommentFileSizeAuthor
#1 regcode_voucher-1294090-1.patch925 bytesjuliakoelsch

Comments

juliakoelsch’s picture

StatusFileSize
new925 bytes

Forgot to attach patch.

aidanlis’s picture

Status: Active » Fixed

Thanks, patch applied!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.