Skip to content
Snippets Groups Projects
Commit c1c82234 authored by srosse's avatar srosse
Browse files

OO-1957: copy the media container with the resource

parent b4cb6d49
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ import org.olat.core.util.vfs.LocalFolderImpl;
import org.olat.core.util.vfs.VFSContainer;
import org.olat.core.util.vfs.VFSItem;
import org.olat.core.util.vfs.VFSLeaf;
import org.olat.core.util.vfs.VFSManager;
import org.olat.course.assessment.manager.AssessmentModeDAO;
import org.olat.course.assessment.manager.UserCourseInformationsManager;
import org.olat.course.certificate.CertificatesManager;
......@@ -227,10 +228,16 @@ public class RepositoryServiceImpl implements RepositoryService {
RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(sourceEntry);
copyEntry = handler.copy(author, sourceEntry, copyEntry);
//copy the image
RepositoryManager.getInstance().copyImage(sourceEntry, copyEntry);
//copy media container
VFSContainer sourceMediaContainer = handler.getMediaContainer(sourceEntry);
if(sourceMediaContainer != null) {
VFSContainer targetMediaContainer = handler.getMediaContainer(copyEntry);
VFSManager.copyContent(sourceMediaContainer, targetMediaContainer);
}
ThreadLocalUserActivityLogger.log(LearningResourceLoggingAction.LEARNING_RESOURCE_CREATE, getClass(),
LoggingResourceable.wrap(copyEntry, OlatResourceableType.genRepoEntry));
......
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