file: eck.entity.inc

function eck__entity__view($entity_type_name, $bundle_name, $id) {
...
  $entity_view[$entity->entityType()][$entity->id] = array_merge($property_view, $entity_view[$entity->entityType()][$entity->id]);
  
  eck_property_behavior_invoke_plugin($entity_type, 'entity_view',
    array('entity' => $entity));
  
  $build["{$entity_type->name}_{$bundle->name}_page"] = $entity_view;

  return $build;
}

Is the real purpose to pass only the $entity object?
Should it pass the $entity_view renderable array for the plugin callback to deal with?

Comments

kolier’s picture

Status: Active » Needs review
StatusFileSize
new715 bytes

Modified, add 'content' to $entity as the official structure of hook_entity_view().

kolier’s picture

Status: Needs review » Needs work
StatusFileSize
new795 bytes

Another patch.

But seems still don't work.

Anybody tell me which function will call eck__entity__view()?

Seems currently, the plugin hook 'entity_view' only for 'full' view mode? Other view mode won't load at all.

fmizzell’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Needs work » Closed (fixed)

In 3.x we have greater separation between the display and the functionality of entity properties. Behaviors are concentrating 100% in functionality, and now we have widgets, and soon formatters to edit or display those properties. The view hook in the behavior might stay just a as means to react when an entity is being viewed, but anything to do with manipulating the view of a property will be managed by formatters.