I wanted to have the 1st attendee's email address field populated with the current user's email address. I had seen in the module where ezra-g had a TODO for this exact functionality. I have created a patch altering function uc_signup_attendees_form_emails to do this. It will set the form element default to the user email if all other attempts to set the default are empty - currently $form_state['values'] and $_SESSION.

CommentFileSizeAuthor
#2 556960.patch986 bytesezra-g
uc_signup_ADD_USER_EMAIL.patch1.88 KBrecrit

Comments

ezra-g’s picture

Priority: Minor » Normal
Status: Needs review » Needs work

Thanks for this patch. This is a handy feature request.

This patch needs some work. When I attempt to checkout for an event with one user who already has an account and one who does not, the profile fields are not presented for the user who does not have an account. As a result, the user is redirected back to the attendee profiles form when they attempt to checkout.

You are changing the structure of the attendee info form, so this is probably where this problem comes from.

Also, it makes sense to check whether the current user is already signed up for a particular event before prepopulating it, otherwise we could prepopulate with data that would fail validation, doesn't seem right.

If you wanted to make this feature a configurable option, that seems great to me but of course is not required. Thanks!

ezra-g’s picture

Status: Needs work » Needs review
StatusFileSize
new986 bytes

The attached patch implements this without a configuration option.

ezra-g’s picture

Status: Needs review » Fixed

This is committed.

recrit’s picture

thanks! my use case did not implement profiles so I did not notice the profile issues you had mentioned. I don't feel it needs to be a configurable option since most users expect fields to pre-populate with their account info.

Status: Fixed » Closed (fixed)

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