Implementing this function in a module causes the user registration page to be blank.

I've narrowed it down to the form group array. If it has any content, the page doesn't display. If it's empty, the page displays with errors.

This works:

function test_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'register':
      return array( array() );
  }
}

This doesn't:

function test_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'register':
      return array( array('title' => t('Test'), 'data' => form_textarea(t('Test'), 'test', '', 70, 3, t('Test form field.'), NULL, TRUE), 'weight' => 1 ) );
  }
}

Comments

chx’s picture

Status: Active » Closed (works as designed)

form_textarea is gone.

spankalee’s picture

I tried replacing the form_textarea call with just a string and it still didn't work (showed a blank page).

Like this:

function test_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'register':
      return array( array('title' => t('Test'), 'data' => <input type="text"/>, 'weight' => 1 ) );
  }
}

I also tried this:

function test_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'register':
      return array( array('title' => t('Test')) );
  }
}

Basically if the form group array has any content at all the user reg form crashes very ungracefully.

The sample code in the CVS HEAD docs uses form_textarea. Should this bug instead be a feature request for an error rather than a blank page. More critically, should hook_user no longer return an array of form groups? Where's the docs on what it should return? If this is really by design, then what's the right way to do it?