Skip to main content

D7 print Print the comment form with PHP

I'm trying to print a comment form with the following code.

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But allAll I get is the following error repeated 40 repetitions oftimes:

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).`

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

There'sThere are actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc). Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

D7 print comment form with PHP

I'm trying to print a comment form with

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But all I get is 40 repetitions of

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).`

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

There's actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc). Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

Print the comment form with PHP

I'm trying to print a comment form with the following code.

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

All I get is the following error repeated 40 times:

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).`

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

There are actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc). Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

Question Protected by CommunityBot
deleted 11 characters in body
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

I'm trying to print a comment form with

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But all I get is 40 repetitions of

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).`

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

EDIT

There's actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc).

Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc). Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

I'm trying to print a comment form with

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But all I get is 40 repetitions of

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

EDIT

There's actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc).

Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

I'm trying to print a comment form with

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But all I get is 40 repetitions of

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).`

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

There's actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc). Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

Tweeted twitter.com/#!/StackDrupal/status/165989686333018112
added 418 characters in body
Source Link
emc
  • 863
  • 1
  • 9
  • 22

I'm trying to print a comment form with

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But all I get is 40 repetitions of

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

EDIT

There's actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc).

Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).

I'm trying to print a comment form with

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But all I get is 40 repetitions of

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

I'm trying to print a comment form with

<?php 
    print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment')); 
?>

But all I get is 40 repetitions of

Warning: Attempt to assign property of non-object in comment_form() (line 1845 of /home/admin/public_html/website.com/modules/comment/comment.module).

The comment form is called from inside a PHP Views field. What is the proper way to add a comment for to a node in Drupal 7?

EDIT

There's actually a lot more errors, most of which repeat at least once:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7501 of /home/admin/public_html/website.com/includes/common.inc).

Notice: Trying to get property of non-object in comment_form() (line 1854 of /home/admin/public_html/website.com/modules/comment/comment.module).
Source Link
emc
  • 863
  • 1
  • 9
  • 22
Loading