Commit 560538d9 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1691329: Fixing folder size call for mysql"

parents 55921e1e 1f3927b3
......@@ -659,10 +659,10 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
}
if ($item->artefacttype == 'folder') {
if ($item->childcount > 0) {
$foldersize = get_record_sql("SELECT SUM(aff.size) FROM {artefact} a
$foldersize = get_record_sql("SELECT SUM(aff.size) AS size FROM {artefact} a
JOIN {artefact_file_files} aff ON aff.artefact = a.id
WHERE a.path LIKE ?", array('%/' . $item->id . '/%'));
$item->foldersize = ArtefactTypeFile::short_size($foldersize->sum, true);
$item->foldersize = ArtefactTypeFile::short_size($foldersize->size, true);
}
else {
$item->foldersize = ArtefactTypeFile::short_size(0, true);
......
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