With the new file_entity_access function, we may run in a new issue, as reported in http://drupal.org/node/1869206#comment-6861674 . It may happen, if there is a media referenced, which no longer exists.

Files: 
CommentFileSizeAuthor
#3 undefined_property-1870636-3.patch572 bytesglen.pinheiro

Comments

camdarley’s picture

I run exactly the same issue, I temporary resolved it by replacing:

function media_gallery_filter_media_access($media_files, $operation) {
  $media_accessable = array();
  foreach ($media_files as $key => $media) {
    if (file_entity_access($operation, (object)$media)) {
      $media_accessable[] = $media;
    }
  }
  return $media_accessable;
}

in media_gallery.module, by

function media_gallery_filter_media_access($media_files, $operation) {
  $media_accessable = array();
  foreach ($media_files as $key => $media) {
    if (isset($media->fid) && file_entity_access($operation, (object)$media)) {
      $media_accessable[] = $media;
    }
  }
  return $media_accessable;
}

Of course, the file is not displayed anymore...

glen.pinheiro’s picture

Assigned: Unassigned » glen.pinheiro
Issue summary: View changes
glen.pinheiro’s picture

Created patch for the above.

glen.pinheiro’s picture

Status: Active » Needs review
glen.pinheiro’s picture

Assigned: glen.pinheiro » Unassigned