From 53e211196671986cb4bf79b57f975bf119bd271a Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 5 Sep 2011 11:52:13 -0700 Subject: Issue #1222576 by jox: Fixed file_usage_list() is defective (might return incomplete results). --- includes/file.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'includes/file.inc') 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; } -- cgit v1.2.3