EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids()

The problem is when I comment to any node by anyonymous user, After commenting that page got an error like

Error: EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7389 of /home/abc/public_html/includes/common.inc).

Solution :

In the /includes/common.inc file line number 7728 there is a code or you can find by copy paste

Original code:

if (!isset($entity->{$info[‘entity keys’][‘bundle’]}) || $entity->{$info[‘entity keys’][‘bundle’]} === ”) {

Replacement code:

if ($entity->{$info[‘entity keys’][‘bundle’]} === ”) {

¬†throw new EntityMalformedException(t(‘Missing bundle property on entity of type @entity_type.’, array(‘@entity_type’ => $entity_type)));

}

May this will be solve your error.

For any query you can comment on this.

It is working for me.