0
votes

Im in the process of integrating the Inline Registration module (http://drupal.org/project/inline_registration) with the Privatemsg module(http://drupal.org/project/privatemsg).

Issue is with passing newly created user info to Privatemsg function so that the message is authored by new user.

Offering a paid solution at http://www.freelancer.com/projects/PHP-Drupal/Drupal-Inline-Registration-Bug-Fix.html. Customized module code included there as well.

Thanks for the help.

/**

* Submit routine for inline registration form. */ function inline_registration_submit($form, &$form_state) { $status_save = $form_state['values']['status']; unset($form_state['values']['uid']); unset($form_state['values']['status']);

user_register_submit($form, $form_state);

$form_state['values']['name'] = $form_state['user']->name; $form_state['values']['uid'] = $form_state['user']->uid; // $form_state['privatemsg']['author']['#value'] = $form_state['user']; $form_state['values']['status'] = $status_save; }

/** * Form function for privatemsg. */ $form['privatemsg']['author'] = array( '#type' => 'value', '#value' => $user, );

1

1 Answers

0
votes

Privatemsg builds the message array/object (D7) in privatemsg_new_validate(). That is then saved in $form_state['validate_built_message']. So you need to add a second validate function that runs after the linked one and change the built message array to whatever you want.

Not really sure where exactly you want to do that, because both the new and reply form is explicitly protected against anonymous access.