Commit ec18759b authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic

Bug 1755329: Calculate folder size only in managing files pages

behatnotneeded

Change-Id: I3d9927777a543441ea00335e625fcd54b5d51ba0
parent 380df0d8
......@@ -14,6 +14,7 @@ define('MENUITEM', 'groups/files');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'file');
define('SECTION_PAGE', 'groupfiles');
define('FOLDER_SIZE', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once(get_config('libroot') . 'group.php');
......
......@@ -14,6 +14,7 @@ define('MENUITEM', 'content/files');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'file');
define('SECTION_PAGE', 'index');
define('FOLDER_SIZE', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('Files', 'artefact.file'));
......
......@@ -15,6 +15,7 @@ define('MENUITEM', 'manageinstitutions/institutionfiles');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'file');
define('SECTION_PAGE', 'institutionfiles');
define('FOLDER_SIZE', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'file');
......
......@@ -677,7 +677,7 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
}
}
if ($item->artefacttype == 'folder') {
if ($item->childcount > 0) {
if ($item->childcount > 0 && defined('FOLDER_SIZE')) {
$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 . '/%'));
......
......@@ -15,6 +15,7 @@ define('MENUITEM', 'configsite/sitefiles');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'file');
define('SECTION_PAGE', 'sitefiles');
define('FOLDER_SIZE', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'file');
......
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