Blank screen

stephan.vanhaverbeke - November 22, 2008 - 17:22
Project:U Create
Version:6.x-1.0-beta1
Component:ucreate_og.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I set up the ucreate module as instructed.

When I submit the form to create a new user, the screen blanks.
The user is created, no e-mail is sent out and the user is not added to a group.

Please advice.

#1

attiks - December 29, 2008 - 23:53

In ucreate_og.module comment line 42 as such

    //dprint_r($edit['og_register']);

#2

attiks - December 30, 2008 - 00:21

Regarding the email use this code

function ucreate_user_create($edit) {
  // Create account.
  $account = new stdClass();
  $password = user_password();
  $edit['pass'] = $password;
  $edit['status'] = 1;
  $account = user_save($account, $edit);

  // Notify user if successful.
  if ($account->uid) {
    drupal_set_message(t('You have created an account for !name, password and login instructions have been sent to the e-mail address !email.', array('!name' => $edit['name'], '!email' => l($edit['mail'], 'mailto:'. $edit['mail']))));

    $subject = t('[!site_name] We have created an account for you', array('!site_name' => variable_get('site_name', 'Drupal')));
    $variables = array(
      '!name' => $edit['name'],
      '!site' => variable_get('site_name', 'Drupal'),
      '!login_url' => user_pass_reset_url($account) .'/login',
      '!url' => $base_url,
      '!password' => $password,
      );
    if (trim($edit['welcome_message_body'])) {
      $body .= $edit['welcome_message_body'];
      $body .= "\n\n================================================\n";
    }
    else {
      $body .= t("\nHello !name,\n", $variables);
    }
    // @todo: Would love to use one time login link here - alas it is only valid for 24 hrs and needs to be renewed then.
    $body .= t("\nWe have created an account for you on !site\n!url.\n\nYou can log in (!login_url) to the site with the following username and password\n\n!name\n!password\n\nPlease change your password after the first time you log in.\n\nWelcome to !site", $variables);
   
    $params['account'] = $account;
    $params['subject'] = $subject;
    $params['body'] = $body;
    if (!drupal_mail('ucreate', 'create', $edit['mail'], user_preferred_language($account), $params)) {
      drupal_set_message(t('Error sending notification mail to user.'), 'error');
    }
  }
  else {
    drupal_set_message(t('Error creating user.'), 'error');
  }
  return $account;
}

function ucreate_mail($key, &$message, $params) {

  switch($key) {
    case 'create':
      $message['subject'] = $params['subject'];
      $message['body'] = $params['body'];
      break;
  }
}

#3

SomebodySysop - January 6, 2009 - 22:11

Is any of this stuff fixed?

#4

SomebodySysop - January 6, 2009 - 22:12

Is any of this stuff fixed?

#5

Adrian - February 11, 2009 - 08:44

not yet....:(

#6

alex_b - February 11, 2009 - 13:21

Does this bug persist on 6.x-dev?

 
 

Drupal is a registered trademark of Dries Buytaert.