[consulting] two registration form with two content profile and two role

sidharth relhan sidhartharelhan at gmail.com
Mon Jun 28 07:15:23 UTC 2010


i have created two content type one is affiliate and second is service
provider. Both content type are used as register form for anonymous user. on
register role are assign to user as affiliate and service provider. I user
auto assign role module for the role assign and register path define. First
problem that i get is on user/register form i get both content type fields.
Although this problem is solved by using this code in function
content_profile_registration_form_alter(&$form, &$form_state, $form_id) { of
contentprofile/module/content_profile.module foreach
($form['#content_profile_registration_use_types'] as $type => $typename) {
if(arg(1) == 'serviceprovider') { $type = 'service_provider';
content_profile_registration_add_profile_form($type, $form, $form_state); }
if(arg(1) == 'affiliate') { $type = 'affiliate';
content_profile_registration_add_profile_form($type, $form, $form_state); }
} But after that a new problem arose now content type node is not creating i
find that it is because "$form['#validate'][] =
'content_profile_registration_user_register_validate';" is not called in
function content_profile_registration_add_profile_form($type, &$form,
&$form_state) $form['#validate'][] =
'content_profile_registration_user_register_validate'; //changes here if
(!isset($form['#content_profile_weights'])) { $form['#pre_render'][] =
'content_profile_registration_alter_weights'; // $form['#validate'][] =
'content_profile_registration_user_register_validate'; //changes here
$form['#submit'][] = 'content_profile_registration_user_register_submit'; }
now node is creating but node is creating both for service provider and
affiliate. And user role is not defined for new user which is defined if i
not change is validation code but than node is not created. Please help me i
stuck with is problem from 4-5 days.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/consulting/attachments/20100628/792c8ad8/attachment.html 


More information about the consulting mailing list