Problem:
When using LoginToboggan in conjunction with the profile module to display required fields on the user registration form, the profile module's validation process gets skipped. This is because of the following check inside profile_validate_profile:

if (($_GET['q'] == 'user/register') ? 1 : 0) {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}

The registration path is no longer user/register, but is now toboggan/register. I don't think this can be fixed without patching profile.module. A workaround is to create a custom module with a hook_user implementation. I figured I would post this here to save someone else an hour of debugging. :P

4.7 version does not have this problem, because it uses hook_form_alter to alter the registration form itself, rather than hijacking the path.

Comments

hunmonk’s picture

Assigned: Unassigned » hunmonk
Status: Active » Fixed

this rather lovely hack takes care of the problem, and i don't believe it will cause any problems itself...

$_GET['q'] = 'user/register';
user_module_invoke('validate', $edit, $edit, 'account');
$_GET['q'] = 'toboggan/register';

commited.

Anonymous’s picture

Status: Fixed » Closed (fixed)