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

kevinquillen’s picture

Status: Active » Fixed

Alright, I fixed this. Here's what remedied it for me:

  1. Uninstall all SearchAPI modules
  2. Copied the XML files from SearchAPI to Solr (I swore I had done this)
  3. Reinstall SearchAPI modules
  4. Create Index and View

Error went away for me. I am not sure what happened to its entity info to make that error pop up.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.