You are here

function _media_gallery_field_get_items in Media Gallery 7.2

Same name and namespace in other branches
  1. 7 media_gallery.module \_media_gallery_field_get_items()

media_gallery_file_original is not a field and therefore cannot be used by field_get_items.

1 call to _media_gallery_field_get_items()
media_gallery_get_file_ids in ./media_gallery.module
Returns all file IDs attached to a media gallery node.

File

./media_gallery.module, line 850

Code

function _media_gallery_field_get_items($entity_type, $entity, $field_name, $langcode = NULL) {
  if ($entity_type == 'node' && $field_name == 'media_gallery_file_original') {
    $media = $entity->media_gallery_file;
    $entity->media_gallery_file = $entity->media_gallery_file_original;
    $field_name = 'media_gallery_file';
  }
  $items = field_get_items($entity_type, $entity, $field_name, $langcode);
  if (isset($media)) {
    $entity->media_gallery_file = $media;
  }
  return $items;
}