-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.6.3
-
None
-
MOODLE_26_STABLE
We found this error in a specific circumstance.
First, we have a huge database and we discovered that we have 976497 instances of a specific file in mdl_files: an empty file (0ko).
Its impossible to drop this file directly in the file picker but its allowed when the file is in a zip file first before being unzipped.
To reproduce:
- First, you need to do this on a huge database with many empty files. To check if you have many of this file with this query:
SELECT COUNT(*) FROM mdl_files WHERE contenthash = 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
- On your computer, create an empty file and compress it into a zip file
- Create two empty courses
- In the first course create a file resource types
- In this resource, import the zip file
- Unzip the file and delete it to keep only the unzipped empty file.
- In the second course, import the course containing the resource activity with the empty file.
- The error will occur.
A possible solution could be to prevent the deposit of an empty file in a zip file as it is already forbidden outside a zip.
Another would be to see if the import process really needs to loop through all instances of a file that is really expensive in memory.
- duplicates
-
MDL-46079 Restore queries many items from file table when it needs one
-
- Closed
-