-
Bug
-
Resolution: Fixed
-
Minor
-
2.4
-
None
-
MOODLE_24_STABLE
-
MOODLE_24_STABLE
-
MDL-36708-master -
lib/filelib.php:file_is_draft_area_limit_reached() should not consider the file references while checking the size of an area. This means that we have to update file file_get_draft_area_info() which itself could be improved a lot.
Marina's comment on MDL-32639:
There could be a performance improvement, actually not related to the issue itself. While doing review I noticed that function file_get_draft_area_info() is terribly inefficient. Basically all we want is to check if there are any files/subfolders in the area (or path). But instead of doing one simple count() query we retrieve all files and folders and create an instance of stored_file for each of them. There is a function file_storage::is_area_empty() but it does not really do what we need.
Also file_get_draft_area_info() gets the total filesize regardless of whether file is reference or not. I would make another attribute in return value to show filesize of not-reference files.
This issue can potentially create a regression introduced by MDL-33766, which would mean that the Private Files userquota could be reached where as they used references.