function field_attach_prepare_view


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL, $options = array())
cle7 field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL, $options = array())
elmsmedia7 field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL, $options = array())
icor7 field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL, $options = array())
meedjum_blog7 field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL, $options = array())
mooc7 field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL, $options = array())

Prepare field data prior to display.

This function lets field types and formatters load additional data needed for display that is not automatically loaded during field_attach_load(). It accepts an array of entities to allow query optimisation when displaying lists of entities.

field_attach_prepare_view() and field_attach_view() are two halves of the same operation. It is safe to call field_attach_prepare_view() multiple times on the same entity before calling field_attach_view() on it, but calling any Field API operation on an entity between passing that entity to these two functions may yield incorrect results.


$entity_type: The type of $entities; e.g. 'node' or 'user'.

$entities: An array of entities, keyed by entity id.

$view_mode: View mode, e.g. 'full', 'teaser'...

$langcode: (Optional) The language the field values are to be shown in. If no language is provided the current language is used.

array $options: An associative array of additional options. See _field_invoke() for details.

Related topics

16 calls to field_attach_prepare_view()
accessibility_test_render in sites/all/modules/ulmus/accessibility/accessibility.module
comment_build_content in modules/comment/comment.module
Builds a structured array representing the comment's content.
comment_view_multiple in modules/comment/comment.module
Construct a drupal_render() style array from an array of loaded comments.
ctools_node_content_render_node in sites/all/modules/ulmus/ctools/plugins/content_types/node_context/
EntityAPIController::buildContent in sites/all/modules/ulmus/entity/includes/
Implements EntityAPIControllerInterface.

... See full list


modules/field/, line 1133
Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'.


function field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL, $options = array()) {
  // Validate $options since this is a new parameter added after Drupal 7 was
  // released.
  $options = is_array($options) ? $options : array();

  $options['language'] = array();

  // To ensure hooks are only run once per entity, only process items without
  // the _field_view_prepared flag.
  // @todo: resolve this more generally for both entity and field level hooks.
  $prepare = array();
  foreach ($entities as $id => $entity) {
    if (empty($entity->_field_view_prepared)) {
      // Add this entity to the items to be prepared.
      $prepare[$id] = $entity;

      // Determine the actual language to display for each field, given the
      // languages available in the field data.
      $options['language'][$id] = field_language($entity_type, $entity, NULL, $langcode);

      // Mark this item as prepared.
      $entity->_field_view_prepared = TRUE;

  $null = NULL;
  // First let the field types do their preparation.
  _field_invoke_multiple('prepare_view', $entity_type, $prepare, $null, $null, $options);
  // Then let the formatters do their own specific massaging.
  // field_default_prepare_view() takes care of dispatching to the correct
  // formatters according to the display settings for the view mode.
  _field_invoke_multiple_default('prepare_view', $entity_type, $prepare, $view_mode, $null, $options);



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.