Course copy misses files when directory not registered
In main/coursecopy/classes/CourseRestorer.class.php, function restore_documents(), when a file is part of a directory for which the entry cannot be found in the database (for example PDF/abc.pdf can be found in the documents table but PDF/ is not there as a directory), the directory in the destination course is not created, hence no file can be copied in it.
This is generating loss of contents on copy and should be avoided, probably adding a recursive check for the directory's existence. The easiest way to do that would probably to add a "$recursive=false" parameter to main/inc/lib/fileUpload.lib.php's create_unexisting_directory(), which would trigger a recursive mode when set to true. This function is the one called from CourseRestorer.class.php.
Updated by Yannick Warnier about 10 years ago
- Due date set to 08/03/2011
- Status changed from New to Bug resolved
- Assignee set to Yannick Warnier
- Start date changed from 09/03/2011 to 08/03/2011
- % Done changed from 0 to 100
- SCRUM pts - complexity changed from ? to 5