diff --git a/modules/entity/entity.module b/modules/entity/entity.module index 02611e3..37bc5b3 100644 --- a/modules/entity/entity.module +++ b/modules/entity/entity.module @@ -230,7 +230,11 @@ function entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = if ($reset) { entity_get_controller($entity_type)->resetCache(); } - return entity_get_controller($entity_type)->load($ids, $conditions); + $entities = entity_get_controller($entity_type)->load($ids, $conditions); + foreach ($entities as $entity) { + $entity->entity_type = $entity_type; + } + return $entities; } /** @@ -252,7 +256,9 @@ function entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = function entity_load_unchanged($entity_type, $id) { entity_get_controller($entity_type)->resetCache(array($id)); $result = entity_get_controller($entity_type)->load(array($id)); - return reset($result); + $entity = reset($result); + $entity->entity_type = $entity_type; + return $entity; } /**