From 4592b617f84a1260b20ad921f7aa4228ac5ae64f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 12 Feb 2010 16:08:50 +0000 Subject: -Patch #712580 by litwol: fixed user_file_references() --- modules/user/user.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/user/user.module') diff --git a/modules/user/user.module b/modules/user/user.module index 9417f57a8..6f7f1c997 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -809,8 +809,8 @@ function user_file_download($uri) { */ function user_file_references($file) { // Determine if the file is used by this module. - $file_used = (bool) db_query_range('SELECT 1 FROM {users} WHERE picture = :fid', 0, 1, array(':fid' => $file->fid))->fetchField(); - if ($file_used) { + $count = db_query('SELECT COUNT(*) FROM {users} WHERE picture = :fid', array(':fid' => $file->fid))->fetchField(); + if ($count) { // Return the name of the module and how many references it has to the file. return array('user' => $count); } -- cgit v1.2.3