I’ve a profile2 regpath displaying my profile2 type, and Drupal Development Service system default account registration type beneath it. I want to maneuver Drupal Development Service account electronic mail subject up into Drupal Development Service container with Drupal Development Service profile2 fields.
I’ve altered Drupal Development Service type and moved Drupal Development Service account mail subject from Drupal Development Service account type, into Drupal Development Service profile type, and I’ve created a further validation handler to strive insert Drupal Development Service mail worth into Drupal Development Service $form_state worth so Drupal Development Service user_account_form_validate() would not choke on a lacking [‘mail’] index:
operate si_student_form_user_register_form_alter(&$type, &$form_state, $form_id) { international $consumer; // take away fieldgroups and tabs for nameless customers, e.g. /scholar/register if($user->uid == 0) { // transfer electronic mail subject from account to beneath profile2 title fields $electronic mail = $type['account']['mail']; unset($type['account']['mail']); // add electronic mail to profile $type['profile_student']['mail'] = $electronic mail; // change weights $type['profile_student']['mail']['#weight'] = 3; // customized validation handler to inject mail worth into // appropriate place in $form_state['values'] array $type['#validate'][] = '_si_student_register_anonymous_validate'; //dpm($type); } } operate _si_student_register_anonymous_validate($type, &$form_state) { $form_state['values']['mail'] = $form_state['values']['profile_student']['mail']; }
Nevertheless this is not working, and I get Drupal Development Service following:
Any concepts? I am unsure I am taking Drupal Development Service proper method right here. Thanks