It is possible to have a user with extra profile fields.

Is it possible to have further fields on the account for essentially a second person? I think the answer to this is 'yes'.

However - is it possible to have said second user be available so that when an event is booked, the booker can select if they are booking for Person A or Person B on the same email address account?

Comments

PeterCorless’s picture

Apparently it is, but it's not easy. You have to edit this file:

{drupal}/modules/user/user.module

Within that file, there is a section which checks for duplicates:

// Validate the e-mail address, and check if it is taken by an existing user.
if ($error = user_validate_mail($form_state['values']['mail'])) {
form_set_error('mail', $error);
}
elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($form_state['values']['mail']), 'LIKE')->range(0, 1)->execute()->fetchField()) {
// Format error message dependent on whether the user is logged in or not.
if ($GLOBALS['user']->uid) {
form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $form_state['values']['mail'])));
}
else {
form_set_error('mail', t('The e-mail address %email is already registered. Have you forgotten your password?', array('%email' => $form_state['values']['mail'], '@password' => url('user/password'))));
}
}

I am not a PHP guru, but somewhere, in the "elseif" statement, you need to edit that or comment it out, so that it does not check for it to be a duplicate. I am doing a new install and have similar issues, so I will monkey around with it and let you know.

edit: The "else" line seems to also have to be edited out too. I tried it, and must have made a syntax error, because my whole site errored out when I first tried to comment it away. (Good thing I backed up the original file!)

PeterCorless’s picture

Alright... I tried it and tested it. This seems to now work:

// Commenting out this section to allow a user to register more than once with the same email address. petercorless 30 Jun 2012
// elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($form_state['values']['mail']), 'LIKE')->range(0, 1)->execute()->fetchField()) {
// Format error message dependent on whether the user is logged in or not.
// if ($GLOBALS['user']->uid) {
// form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $form_state['values']['mail'])));
// }
// else {
// form_set_error('mail', t('The e-mail address %email is already registered. Have you forgotten your password?', array('%email' => $form_state['values']['mail'], '@password' => url('user/password'))));
// }
//}

YMMV. I have not done any sort of extensive testing. For instance, I have no idea if any other administrative or reporting functions may barf when they see more than one user with the same email address. But it basically allows you to do what you wished. Enjoy!

-Peter Corless.

greggles’s picture

Status: Active » Fixed

I don't think this is really possible/supportable in COD directly, at least not in 6.x.

There's a longstanding issue in #349228: Signup anonymous users without email for the signup module that would need to be fixed first and that's quite unlikely.

The suggestions in #1 and #2 are for hacking core which is generally not appropriate, so I don't suggest others head down that road.

You could achieve similar results by disabling signup and converting the signup process to instead rely on product purchases or something like that. Marking "fixed" as a support request, but if you feel this should be re-opened please do it.

Status: Fixed » Closed (fixed)

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