Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Line 7409 of common.inc has this:
throw new EntityMalformedException(t('Missing bundle property on entity of type @entity_type.', array('@entity_type' => $entity_type)));
I suggest it be this:
throw new EntityMalformedException(t('Missing bundle property (\'' .$info['entity keys']['bundle'] .'\') on entity of type @entity_type.', array('@entity_type' => $entity_type)));
Motivation:
This is a more useful error message. It may be that the entity's bundle property is not called 'bundle'. The suggested message indicates the name that the entity designer has called the bundle property.