function file_entity_field_formatter_prepare_view in File Entity (fieldable files) 7.3
Same name and namespace in other branches
- 7.2 file_entity.field.inc \file_entity_field_formatter_prepare_view()
Implements hook_field_formatter_prepare_view().
File
- ./
file_entity.field.inc, line 339 - Field API integration for the file_entity module.
Code
function file_entity_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_entity_field_formatter_view().
foreach (array_keys($entities) as $id) {
$items[$id] = array_filter($items[$id]);
}
}