Commit 57f967f1 authored by guillaumev's avatar guillaumev Committed by Neil Hastings
Browse files

Issue #1891210 by valderama, guillaumev: Fixed Incompatible with entity...

Issue #1891210 by valderama, guillaumev: Fixed Incompatible with entity reference formatter Rendered Entity
parent 95c26b19
Loading
Loading
Loading
Loading
+13 −0
Changes for bean.module: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ function bean_entity_info() {
      'label callback' => 'entity_class_label',
      'uri callback' => 'entity_class_uri',
      'access callback' => 'bean_access',
      'view callback' => 'bean_view_callback',
      'module' => 'bean',
      'metadata controller class' => 'BeanMetadataController',
      'view modes' => array(
@@ -775,6 +776,18 @@ function bean_view(Bean $bean, $view_mode = 'default', $langcode = NULL) {
  return $bean->view($view_mode, $langcode);
}

/**
 * View callback
 */
function bean_view_callback($entities, $view_mode, $langcode, $entity_type) {
  $render = array();
  foreach($entities as $key => $entity) {
    $id = entity_id($entity_type, $entity);
    $render[$entity_type][$id] = bean_view($entity, $view_mode, $langcode);
  }
  return $render;
}

/**
 * Implements hook_block_info().
 */