Commit e2163264 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix bad MySQL query in file quota cron job


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent c16acb88
......@@ -224,14 +224,14 @@ class PluginArtefactFile extends PluginArtefact {
public static function recalculate_quota() {
$data = get_records_sql_assoc("
SELECT a.owner, SUM(f.size) AS usage
SELECT a.owner, SUM(f.size) AS bytes
FROM {artefact} a JOIN {artefact_file_files} f ON a.id = f.artefact
WHERE a.artefacttype IN ('file', 'image', 'profileicon', 'archive')
AND a.owner IS NOT NULL
GROUP BY a.owner", array()
);
if ($data) {
return array_map(create_function('$a', 'return $a->usage;'), $data);
return array_map(create_function('$a', 'return $a->bytes;'), $data);
}
return array();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment