Skip to content
Snippets Groups Projects
Commit eab8a13b authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #341910 by mayer: make file_space_used work on PostgreSQL.

parent dc82bc5a
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -771,9 +771,9 @@ function file_unmanaged_delete($path) {
*/
function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) {
if (!is_null($uid)) {
return db_query('SELECT SUM(filesize) FROM {files} WHERE uid = :uid AND status & :status', array(':uid' => $uid, ':status' => $status))->fetchField();
return db_query('SELECT SUM(filesize) FROM {files} WHERE uid = :uid AND status = :status', array(':uid' => $uid, ':status' => $status))->fetchField();
}
return db_query('SELECT SUM(filesize) FROM {files} WHERE status & :status', array(':status' => $status))->fetchField();
return db_query('SELECT SUM(filesize) FROM {files} WHERE status = :status', array(':status' => $status))->fetchField();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment