Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-12008 Enotice fixes on create user #31

Merged
merged 2 commits into from
Mar 5, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CRM/Utils/System/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down