drupaldrupal-6drupal-fapidrupal-formsdrupal-render

drupal_render returns nothing, depending on previous script and php tags


I created a template, my-node-form.tpl.php, to theme a particular form. If this is the template content, then drupal_render works fine:

<?php
?>
<?php 
    dsm ("debug.  inside my-node-form.tpl.php");
    foreach ($fieldnames as $fieldname){
      print drupal_render($form[$fieldname]);
    }
    return;
?> 

However, if there is a blank line between the two sets of php-tags, then drupal_render returns nothing:

<?php
?>

<?php 
    dsm ("debug.  inside my-node-form.tpl.php");
    foreach ($fieldnames as $fieldname){
      print drupal_render($form[$fieldname]);
    }
    return;
?> 

Anyone know why this is?


Solution

  • I had a bug which corrupted some of the formfield data. I fixed the bug and drupal_render now works fine.