I'm trying to track down some performance issues on a Drupal 7 site where out of nowhere the site will stall rendering content or dealing with administrative duties like updating a piece of content. Checking the logs, I've found errors when cron runs for:
- EntityMalformedException: Missing bundle property on entity of type node
- Notice: Undefined property: stdClass::$nid in node_build_content()
- Notice: Trying to get property of non-object in _node_index_node()
This prompted me to create a view to look at all content types and return
This view shows the majority of site content has entity_id = 0 and entity_type = null (nothing).
Out of roughly 400 nodes, less than 20 have proper entity_types and entity_id values. Even creating a simple basic page with a title and body results in entity_id = 0 and no value for the entity_type.
You would think that the content wouldn't render however, all of this content will render at /node/xxx or pulled up in views and can be edited as usual.
I think this is one of the causes of the poor performance if not the cause so I'm looking to repair the broken nodes and and prevent this site from continuing this odd behavior. I'm pretty sure the entity_id should equal node_id and I'm pretty sure the entity_type should equal node.