- Patch #1065020 by Berdir: fixed E_STRICT warning when downloading/viewing a file or image.

merge-requests/26/head
Dries Buytaert 2011-04-10 21:42:20 +02:00
parent 5e1e44c4c0
commit c5425cbfba
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ function file_file_download($uri, $field_type = 'file') {
foreach ($field_references as $entity_type => $type_references) {
foreach ($type_references as $id => $reference) {
// Try to load $entity and $field.
$entity = reset(entity_load($entity_type, array($id)));
$entity = entity_load($entity_type, array($id));
$entity = reset($entity);
$field = NULL;
if ($entity) {
// Load all fields for that entity.