summaryrefslogtreecommitdiff
path: root/modules/file
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-06-14 15:41:03 +0000
committerDries Buytaert <dries@buytaert.net>2010-06-14 15:41:03 +0000
commit9cf21be9949ad70b4fb41eed0d4b8204afead2f8 (patch)
treec01d1e3cc750c26a541f81a293ea9bcbd64d73a8 /modules/file
parentf6d56f96c306a9e9ec3202c087321edc39d65b03 (diff)
downloadbrdo-9cf21be9949ad70b4fb41eed0d4b8204afead2f8.tar.gz
brdo-9cf21be9949ad70b4fb41eed0d4b8204afead2f8.tar.bz2
- Patch #780154 by chx, noahb, dhthwy, pwolanin, aspilicious, jhodgdon, dereine, bjaspan: listing API for field API.
Diffstat (limited to 'modules/file')
-rw-r--r--modules/file/file.module7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/file/file.module b/modules/file/file.module
index 350387a86..92d0f95a0 100644
--- a/modules/file/file.module
+++ b/modules/file/file.module
@@ -969,8 +969,11 @@ function file_get_file_references($file, $field = NULL, $age = FIELD_LOAD_REVISI
foreach ($fields as $field_name => $file_field) {
if ((empty($field_type) || $field['type'] == $field_type) && !isset($references[$field_name])) {
// Get each time this file is used within a field.
- $cursor = 0;
- $references[$field_name] = field_attach_query($file_field['id'], array(array('fid', $file->fid)), array('limit' => FIELD_QUERY_NO_LIMIT, 'cursor' => &$cursor, 'age'=> $age));
+ $query = new EntityFieldQuery;
+ $query
+ ->fieldCondition($file_field, 'fid', $file->fid)
+ ->age($age);
+ $references[$field_name] = $query->execute();
}
}