Skip to content
Snippets Groups Projects
Commit a88c414c authored by Moritz Strohm's avatar Moritz Strohm
Browse files

FileArchiveManager::addFileTypeToArchive: call convertToStandardFile on files...

FileArchiveManager::addFileTypeToArchive: call convertToStandardFile on files that aren't StandardFile instances before requesting their path, re #2987

Merge request studip/studip!2003
parent f883fc3b
No related branches found
No related tags found
No related merge requests found
...@@ -131,6 +131,14 @@ class FileArchiveManager ...@@ -131,6 +131,14 @@ class FileArchiveManager
return true; return true;
} }
} else { } else {
if (!($file_type instanceof StandardFile)) {
$file_type = $file_type->convertToStandardFile();
}
if (!($file_type instanceof StandardFile)) {
//The file type could not be converted to a standard file.
//We cannot continue.
return false;
}
//Get the file's path (if the file exists) and add the file to the archive: //Get the file's path (if the file exists) and add the file to the archive:
$path = $file_type->getPath(); $path = $file_type->getPath();
if ($path) { if ($path) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment