Trying to add fields to a view results in entity malformed exception, generated here (even with patch to common.inc #1067750: Let Field API fail in a tale-telling way on invalid $entity):
function entity_extract_ids($entity_type, $entity) {
$info = entity_get_info($entity_type);
// Objects being created might not have id/vid yet.
$id = isset($entity->{$info['entity keys']['id']}) ? $entity->{$info['entity keys']['id']} : NULL;
$vid = ($info['entity keys']['revision'] && isset($entity->{$info['entity keys']['revision']})) ? $entity->{$info['entity keys']['revision']} : NULL;
if (!empty($info['entity keys']['bundle'])) {
// Explicitly fail for malformed entities missing the bundle property.
if (!isset($entity->{$info['entity keys']['bundle']}) || $entity->{$info['entity keys']['bundle']} === '') {
throw new EntityMalformedException(t('Missing bundle property on entity of type @entity_type.', array('@entity_type' => $entity_type)));
}
$bundle = $entity->{$info['entity keys']['bundle']};
}
else {
// The entity type provides no bundle key: assume a single bundle, named
// after the entity type.
$bundle = $entity_type;
}
return array($id, $vid, $bundle);
}
Drealty listing types are specified as a bundle of property for drealty_listing entities. It loads in all property types into the bundles array of drealty_listing when entity_get_info is called, so I am not sure why this is now failing.
Comments
Comment #1
kevinquillen commentedAlright, I fixed this. Here's what remedied it for me:
Error went away for me. I am not sure what happened to its entity info to make that error pop up.