How to add a form to $node in hook_node_load()? I want to add a form to a node before it is passed along to the theme layer. 

My module has a hook_node_load, as follows: 

function gp_shop_node_load($nodes, $types) {
  foreach($nodes as $nid =&gt; $node) {
    //Determine if we should process. aka: only run on Record-&gt;type() types.
    if (!in_array("product", $types)) {
      continue;
    }

    $nodes[$nid]-&gt;gp_shop_order_button = "[BUTTON]";
  }
}


This works: the text [BUTTON] is added to $node if it is type "product";

However, when placing an actual form, it breaks in a Maximum function nesting level of '100' reached, aborting!-error. An endless loop of some sorts. As follows:

    $nodes[$nid]-&gt;gp_shop_order_button = drupal_get_form("gp_shop_order_button", $node);


Edit: In the final code, I problably have to wrap this in a drupal_render() even; for now it makes no difference. The relevant line would then be:

$nodes[$nid]-&gt;gp_shop_order_button = drupal_render(drupal_get_form("gp_shop_order_button", $product));


And then with the callback-hook for the form.

function gp_shop_order_button($form, &amp;$form_state, $node) {
  $form = array();

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Order',
  );

  return $form;
}


The part about passing along the $nodeis not very relevant and is not causing the problem. Just left it in my examples here, to illustrate that passing along parameters is a requirement.

What am I doing wrong?
Not entirely sure why hook_node_load does not work, but some trial and error (in contrast to the documentation) led me to a working solution using hook_node_view instead.

The example code being:

function gp_shop_node_view($node, $view_mode, $langcode) {
  if ("product" == $node-&gt;type) {
    if ($view_mode == 'full' &amp;&amp; node_is_page($node)) {
      $node-&gt;content['gp_shop_order_button'] = drupal_get_form("gp_shop_order_button", $node);
      }
    }
  }
}

function gp_shop_order_button($form, &amp;$form_state, $node) {
  $form = array();

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Order',
  );

  return $form;
}