Getting Entity Malformed Exception error while adding a taxonomy term in drupal7

Ranjani picture Ranjani · Apr 5, 2012 · Viewed 10.4k times · Source

I'm using Drupal7. When i'm adding a new term in a taxonomy vocabulary getting the following error.

"Entity Malformed excetion : Missing bundle property on entity of type node.in entity_extract_ids()(line 7409 of /home/clutch2/sitename/html/drupal/includes/common.inc."

And when i'm viewing the list of terms in the taxonomy vocabulary in which i attempted to

add a new one, that showing the term which i added. What i have to do to get rid out of

this error message ?Can Anyone help me in this?

Answer

kenorb picture kenorb · Apr 9, 2013

This problem can be caused by the several reason, depending which modules are you using.


Solution:

Taxonomy Orphanage module should help you with removing orphaned taxonomy term references from entities as currently this is not fixed yet in the Drupal 7.x core. If this won't work, try Field reference delete module.


You can also track the problem manually. Here is sql query which I've used to track the invalid references:

drush sqlq "SELECT nid, title from node WHERE nid IN (select entity_id from  field_data_field_some_ref WHERE field_some_ref_tid not IN (select tid from taxonomy_term_data));"

Where field_data_field_some_ref is data field of field_some_ref which is type of 'Term reference'.