I've successfully printed a comment form on a views-built page using a PHP Views field (as found in this question). The form doesn't submit right away though - instead of submitting, the comment "save" button redirects to the "comment/reply/[nid]" page with blank values.
Comment form print code:
$comment = new stdClass;
$comment->nid = $row->nid;
$form = drupal_get_form('comment_form', $comment);
print render($form);
Are there extra details that should be added to the $comment object before or during the drupal_get_form()
or render()
calls?