Calling entity_view('file', $files) returns data in the following format:

array (
  'files' => 
  array (
  ),
)

But the resulting array *should* be keyed by entity type, which is 'file', not 'files':

array (
  'file' => 
  array (
  ),
)

We need to implement the same solution as the view callback for nodes which converts the result to the proper array.

CommentFileSizeAuthor
#1 2365821-fix-entity-view-result.patch1.12 KBDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Needs review
FileSize
1.12 KB
Dave Reid’s picture

Status: Needs review » Fixed

Committed #1 to 7.x-2.x.

  • Dave Reid committed afad954 on 7.x-2.x
    Issue #2365821 by Dave Reid: Fixed entity_view('file') returns data...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.