<div dir="ltr">I have the following in a custom module<div><br><div><div>function email_subscription_block_view($delta) {</div><div>  $content = &#39;&#39;;</div><div>  switch ($delta) {</div><div>    case &#39;subscribe&#39;:</div>
<div>      $content = drupal_get_form(&#39;email_subscription_form&#39;);<br></div><div>  }</div><div>  $subject = NULL;</div><div><br></div><div>  return array(&#39;subject&#39; =&gt; $subject, &#39;content&#39; =&gt; $content);</div>
<div>}</div><div><br></div><div>function email_subscription_theme() {<br></div><div>  return array(</div><div>    &#39;email_subscription_form&#39; =&gt; array(</div><div>      &#39;arguments&#39; =&gt; array(&#39;form&#39; =&gt; NULL),</div>
<div>      &#39;render element&#39; =&gt; &#39;form&#39;,</div><div>      &#39;template&#39; =&gt; &#39;block--email-subscription&#39;,</div><div>    ),</div><div>  );</div><div>}</div><div><br></div><div>function email_subscription_form($form, &amp;$form_state) {<br>
</div><div>  $form[&#39;email&#39;] = array(</div><div>    &#39;#type&#39; =&gt; &#39;textfield&#39;,</div><div>    &#39;#size&#39; =&gt; 15,</div><div>    &#39;#maxlength&#39; =&gt; 128,</div><div>    &#39;#required&#39; =&gt; TRUE,</div>
<div>  );</div><div><br></div><div>  $form[&#39;submit&#39;] = array(</div><div>    &#39;#type&#39; =&gt; &#39;submit&#39;,</div><div>    &#39;#value&#39; =&gt; t(&#39;sign up&#39;),</div><div>  );</div><div><br></div><div>
  $form[&#39;#theme&#39;][] = &#39;email_subscription_form&#39;;</div><div><br></div><div>  return $form;</div><div>}</div><div><br></div><div>In my template I have the following:</div><div><br></div><div><div>&lt;div id=&quot;email-subscription&quot;&gt;</div>
<div>  &lt;form id=&quot;email-subscription-form&quot; class=&quot;email_subscription_form form&quot;&gt;</div><div>    &lt;?php print render($form[&#39;email&#39;]);?&gt;</div><div>    &lt;?php print render($form[&#39;submit&#39;]);?&gt;</div>
<div>  &lt;/form&gt;</div><div>&lt;/div&gt;</div></div><div><br></div><div>With this the two elements of the form render properly. If, instead I have:</div><div><br></div><div><div>&lt;div id=&quot;email-subscription&quot;&gt;</div>
<div>  &lt;form id=&quot;email-subscription-form&quot; class=&quot;email_subscription_form form&quot;&gt;</div><div>    &lt;?php print render($form);?&gt;</div><div>  &lt;/form&gt;<br></div><div>&lt;/div&gt;</div></div><div>
<br></div><div>I get a wsod and the log saying memory was exhausted.</div><div><br></div>-- <br>---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div><div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div>
<div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div><div>@accidentalcoder</div>
</div></div></div>