1 file.field.inc file_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays)

Implements hook_field_formatter_prepare_view().

File

core/modules/file/file.field.inc, line 989
Field module functionality for the File module.

Code

function file_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) {
  // File and image fields set item values to NULL if a file cannot be loaded.
  // Remove those empty items so we can simply iterate through $items normally
  // in file_field_formatter_view().
  foreach (array_keys($entities) as $id) {
    $items[$id] = array_filter($items[$id]);
  }
}