Copy linkedFileData when cloning a project

This commit is contained in:
Shane Kilkelly 2018-06-22 10:00:39 +01:00
parent d36dbfda07
commit 5abb745e05

View file

@ -55,7 +55,10 @@ module.exports = ProjectEntityUpdateHandler = self =
logger.err { project_id, folder_id, originalProject_id, origonalFileRef }, "file trying to copy is null"
return callback()
# convert any invalid characters in original file to '_'
fileRef = new File name : SafePath.clean(origonalFileRef.name)
fileProperties = name : SafePath.clean(origonalFileRef.name)
if origonalFileRef.linkedFileData?
fileProperties.linkedFileData = origonalFileRef.linkedFileData
fileRef = new File(fileProperties)
FileStoreHandler.copyFile originalProject_id, origonalFileRef._id, project._id, fileRef._id, (err, fileStoreUrl)->
if err?
logger.err { err, project_id, folder_id, originalProject_id, origonalFileRef }, "error coping file in s3"