Skip to content
Snippets Groups Projects
Commit 00cef8e1 authored by Ron Lucke's avatar Ron Lucke Committed by Elmar Ludwig
Browse files

refs #312

parent 3386b69f
No related branches found
No related tags found
No related merge requests found
......@@ -303,14 +303,17 @@ abstract class BlockType
protected function copyFileById(string $fileId, string $rangeId): string
{
$user = \User::findCurrent();
if ($file_ref = \FileRef::find($fileId)) {
$copiedFile = \FileManager::copyFile(
$file_ref->getFiletype(),
$this->getDestinationFolder($user, $rangeId),
$user
);
$copiedFile = \FileManager::copyFile(
\FileRef::find($fileId)->getFiletype(),
$this->getDestinationFolder($user, $rangeId),
$user
);
return $copiedFile->id;
}
return $copiedFile->id;
return '';
}
/**
......@@ -325,14 +328,17 @@ abstract class BlockType
{
$user = \User::findCurrent();
$destinationFolder = $this->getDestinationFolder($user, $rangeId);
$sourceFolder = \Folder::find($folderId)->getTypedFolder();
$copiedFolder = \FileManager::copyFolder(
$sourceFolder,
$destinationFolder,
$user
);
if ($sourceFolder = \Folder::find($folderId)) {
$copiedFolder = \FileManager::copyFolder(
$sourceFolder->getTypedFolder(),
$destinationFolder,
$user
);
return $copiedFolder->id;
}
return $copiedFolder->id;
return '';
}
private function getDestinationFolder(\User $user, string $rangeId): \StandardFolder
......
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