Fatal error: Unsupported operand types in email_registration.module on line 61

You will get this error if you have logintoboggan and email_registration installed within Drupal 5 and visit the site as an anonymous user with the user login block enabled.  This is caused by the modifications made to the user login block by the logintoboggan module.

You can fix this without hacking the email_registration.module file.

Fix

While logged in as an admin (if you can’t get in to the site to login, go to http://www.domain.com/user, as this will only load up the main user login form and not the block), go to Admin –> Site Building –> Blocks.  Click Configure next to User login.  Under Block type, select the radio button that says Standard. Then save the block.  Now try to visit the site as an anonymous user and it should be working.

Hack fix

Within the email_registration.module file, you will need to add some code to the module.

On lines 59-62, you will find the following:

case 'user_login_block':
  $form['name']['#title'] = t('E-mail');
 
$form['#validate'] = array('email_registration_user_login_validate' => array()) + $form['#validate'];
 
break;

You need to change it to this:

case 'user_login_block':
  if (!empty($form[‘#validate’)) {

    $form['name']['#title'] = t('E-mail');
   
$form['#validate'] = array('email_registration_user_login_validate' => array()) + $form['#validate'];
  }
 
break;

Save the module and it should work as expected.

The problem

Logintoboggan adds the ability to change the appearance of the user login block to show just a link rather than the form that Drupal usually ships with, this in turn means that there are no $form array elements for hook_form_alter to use.