summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-25 12:19:34 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-25 12:19:34 +0000
commitad9c37ffd474c33d8a3ec22104985a310a20d958 (patch)
treedd803056c6153e3a460f706bbac7d8e39600677d /modules/system
parentcca8e7e5acf71bc1462ef9197858a1629e96e6a3 (diff)
downloadbrdo-ad9c37ffd474c33d8a3ec22104985a310a20d958.tar.gz
brdo-ad9c37ffd474c33d8a3ec22104985a310a20d958.tar.bz2
- Patch #747464 by andypost: fixed wrong usage of hook_file_references().
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.api.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index c43bcf05e..6ff9be0ec 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -1734,10 +1734,10 @@ function hook_file_move($file, $source) {
*/
function hook_file_references($file) {
// If user.module is still using a file, do not let other modules delete it.
- $count = (int) db_query('SELECT COUNT(picture) FROM {users} WHERE picture = :fid', array(':fid' => $file->fid))->fetchField();
- if ($count) {
+ $file_used = (bool) db_query_range('SELECT 1 FROM {user} WHERE pictire = :fid', 0, 1, array(':fid' => $file->fid))->fetchField();
+ if ($file_used) {
// Return the name of the module and how many references it has to the file.
- return array('user' => $count);
+ return array('user' => 1);
}
}