I am getting the below error when I used drupal_render(drupal_get_form('my_form')) on a page in Drupal 7 Installation.

Only variables should be passed by reference in my_custom_function() (line 16 of /modules/php/php.module(80) : eval()'d code)

Comments

longwave’s picture

Status: Active » Fixed

drupal_render() takes a reference, so you cannot pass drupal_get_form() to it like that.

Try:

$build = drupal_get_form('my_form');
drupal_render($build);
kirantej_p’s picture

Thank you very much. I've been working on it since 2 days.
Thanks once again.

kirantej_p’s picture

Status: Fixed » Closed (fixed)

Thanks. Issue closed.