As entity_get_info() handles the missing bundles key for single bundles:

  // If no bundle key is provided, assume a single bundle, named after
  // the entity type.
  if (empty($entity_info[$name]['entity keys']['bundle']) && empty($entity_info[$name]['bundles'])) {
    $entity_info[$name]['bundles'] = array($name => array('label' => $entity_info[$name]['label']));

we should document this behaviour at the hook_entity_info() docs.
d7-patch-entity-docs.patch986 bytesalippai
PASSED: [[SimpleTest]]: [MySQL] 39,672 pass(es).
[ View ]


jhodgdon’s picture

Assigned:Unassigned» jhodgdon
Status:Needs review» Reviewed & tested by the community

Thanks! This looks like a good addition to the documentation. And only for 7.x. I'll get it committed shortly.

jhodgdon’s picture

Assigned:jhodgdon» Unassigned
Status:Reviewed & tested by the community» Fixed

Committed to 7.x. Thanks again!

Status:Fixed» Closed (fixed)

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