summaryrefslogtreecommitdiff
path: root/includes/file.inc
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-09-05 11:52:13 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-09-05 11:52:13 -0700
commit53e211196671986cb4bf79b57f975bf119bd271a (patch)
tree9af19c8d9788790c415b89c62cc8160abf97d722 /includes/file.inc
parent73b7dae00657c93fedf26398849eaf79d1d2c5c3 (diff)
downloadbrdo-53e211196671986cb4bf79b57f975bf119bd271a.tar.gz
brdo-53e211196671986cb4bf79b57f975bf119bd271a.tar.bz2
Issue #1222576 by jox: Fixed file_usage_list() is defective (might return incomplete results).
Diffstat (limited to 'includes/file.inc')
-rw-r--r--includes/file.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/file.inc b/includes/file.inc
index 4fb56e8a4..69e2a6242 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -605,7 +605,8 @@ function file_save(stdClass $file) {
*
* @return
* A nested array with usage data. The first level is keyed by module name,
- * the second by object type, the third has 'id' and 'count' keys.
+ * the second by object type and the third by the object id. The value
+ * of the third level contains the usage count.
*
* @see file_usage_add()
* @see file_usage_delete()
@@ -618,7 +619,7 @@ function file_usage_list(stdClass $file) {
->execute();
$references = array();
foreach ($result as $usage) {
- $references[$usage->module][$usage->type] = array('id' => $usage->id, 'count' => $usage->count);
+ $references[$usage->module][$usage->type][$usage->id] = $usage->count;
}
return $references;
}