diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-03-21 20:28:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-03-21 20:28:28 +0000 |
commit | e1799e761b909775da0141e70e06e351d31bf362 (patch) | |
tree | 0db0538bcffcb6cad32f2cac97f31c3fe27093b7 /modules/user/user.module | |
parent | f505b6a97800a52f6bfc39ddccbb06077291fefe (diff) | |
download | brdo-e1799e761b909775da0141e70e06e351d31bf362.tar.gz brdo-e1799e761b909775da0141e70e06e351d31bf362.tar.bz2 |
- Patch #747464 by andypost: wrong usage of hook_file_references().
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index b62efd70d..2ec522113 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -775,8 +775,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 = (int) db_query('SELECT COUNT(1) 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); } |