MNT-19682 : Fix upload of document versions with different mime types (#623)

This commit is contained in:
Chris Shields
2020-04-23 17:01:00 +01:00
committed by GitHub
parent 3c1e18d266
commit b37c73b0e4

View File

@@ -309,11 +309,11 @@ function main()
return; return;
} }
var newFilename = filename;
if (updateNameAndMimetype) if (updateNameAndMimetype)
{ {
//check to see if name is already used in folder //check to see if name is already used in folder
var existingFile = updateNode.getParent().childByNamePath(filename), var existingFile = updateNode.getParent().childByNamePath(filename);
newFilename = filename;
var existingFileNodeRef = (existingFile !== null) ? String(existingFile.nodeRef) : '', var existingFileNodeRef = (existingFile !== null) ? String(existingFile.nodeRef) : '',
updateFileNodeRef = String(updateNodeRef); updateFileNodeRef = String(updateNodeRef);
if (existingFile !== null && existingFileNodeRef !== updateFileNodeRef) if (existingFile !== null && existingFileNodeRef !== updateFileNodeRef)
@@ -354,7 +354,7 @@ function main()
} }
// Update the working copy content // Update the working copy content
updateNode.properties.content.write(content, updateNameAndMimetype, true); updateNode.properties.content.write(content, updateNameAndMimetype, true, newFilename);
// check it in again, with supplied version history note // check it in again, with supplied version history note
// Extract the metadata // Extract the metadata