The block seems to be up and working fine however, when I enable emma registrations, new users always get an error "The email address provided was not valid. Registration successful. You are now logged in.". No email is added to the group on emma. Is anyone else experiencing this? I'll try to test on a clean system when I get a chance.

Comments

dvancamp’s picture

hook_user() is setting the $form_state wrong. Email needs to be in the 'values' array.

function emma_block_user($op, &$edit, &$account, $category = NULL) {
  if ($op == 'insert') {
    $form_state['values'] = array(
      'email_address' => $edit['mail'],
      'first_name' => NULL, /* no name field on default drupal block */
      'last_name' => NULL,  /* no name field on default drupal block */
    );
    foreach( $edit['list'] as $lid => $lv ) {
      emma_block_subscribe_member( $lid, $form_state );
    }
  }
}

Versus

function emma_block_user($op, &$edit, &$account, $category = NULL) {
  if ($op == 'insert') {
    $form_state = array(
      'email_address' => $edit['mail'],
      'first_name' => NULL, /* no name field on default drupal block */
      'last_name' => NULL,  /* no name field on default drupal block */
    );
    foreach( $edit['list'] as $lid => $lv ) {
      emma_block_subscribe_member( $lid, $form_state );
    }
  }
}
elusivemind’s picture

Assigned: Unassigned » elusivemind

I will be issuing a patch for this in the next revision.. will close ticket when it is done.

elusivemind’s picture

Status: Active » Closed (fixed)

Change made. Thank you for the heads up. Sorry it took so long to get implemented.