saving invalid entity such as:
- missing
type
from the node object (e.g. wrongly generated by Devel Generate?);
- missing
orphaned nodes in node table;
having orphaned nodes, caused by:
- search view having indexed nodes which aren't in the system;
- other modules (like Feeds) removing nodes from Drupal improperly;
nodes having invalid/non-existing references; for term data this can be checked by:
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 offield_some_ref
which is type of 'Term reference'.See: DB records not deleted for Term Reference Fields after Term is Deleted
having orphaned taxonomy terms (so you may use Taxonomy Orphanage);
when using Rules Link module;
invalid custom code (human error) such as:
- badly implemented Entity API,
- badly implemented CTools/Form API,
!empty()
test on the entity variable before callingfield_get_items()
,- rendering field by invalid calls,
- triggering functions which shouldn't be triggered on certain pages (e.g. field_view_field()),