drupal_get_form renders blank page I'm building a module for basic e-mail sharing that will present a form on every node. So I hook into nodes and add a new variable called share_form which is supposed to contain the from from email_share_node_form after it has been fetched with drupal_get_form.

I have been checking out loads of examples and as far as I can see I'm doing everything right. But the page turns completely blank, with no errors either in the reports or on the page. The same occurs when I use other form_ids such as user_register_form that is supposed to work.

If I add any normal string to share_form the page renders with no issues at all. So the error is definitely occuring inside drupal_get_form.

Is there obvious error in my code? How can I debug this?

UPDATE: If I put the render(drupal_get_form('email_share_node_form')) in my node.tpl.php it renders just fine. Why not in the module?

/**
 * Hook into node_load to insert an e-mail share form.
 */
function email_share_node_load($nodes, $types) {
  foreach ( $nodes as $nid =&gt; $node ) {
    $nodes[$nid]-&gt;share_form = drupal_get_form('email_share_node_form');
  }
}

// --------------------------------------------------

/**
 * Create a share-form to display on a node.
 */
function email_share_node_form($form, &amp;$form_state) {
  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Submit')
  );

  return $form;
}


Thanks
If you have a white page then there is very likely an error somewhere. Check your apache or php error logs. Which could really be any where depend on what platform you are developing on.

Fatal errors won't make it into the database log file within Drupal since fatal errors tend to stop everything dead.