diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 44adea35fb24..089a793ebba9 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -72,9 +72,15 @@ function createUser(&$params, $mail) { $form_state['rebuild'] = FALSE; $form_state['programmed'] = TRUE; + $form_state['complete form'] = FALSE; $form_state['method'] = 'post'; $form_state['build_info']['args'] = array(); - + /* + * if we want to submit this form more than once in a process (e.g. create more than one user) + * we must force it to validate each time for this form. Otherwise it will not validate + * subsequent submissions and the manner in which the password is passed in will be invalid + * */ + $form_state['must_validate'] = TRUE; $config = CRM_Core_Config::singleton(); // we also need to redirect b @@ -83,7 +89,8 @@ function createUser(&$params, $mail) { $form = drupal_retrieve_form('user_register_form', $form_state); $form_state['process_input'] = 1; $form_state['submitted'] = 1; - + $form['#array_parents'] = array(); + $form['#tree'] = FALSE; drupal_process_form('user_register_form', $form, $form_state); $config->inCiviCRM = FALSE;