From b37c73b0e43530c4ea1173e65d08c1ed6706cd2d Mon Sep 17 00:00:00 2001 From: Chris Shields Date: Thu, 23 Apr 2020 17:01:00 +0100 Subject: [PATCH] MNT-19682 : Fix upload of document versions with different mime types (#623) --- .../org/alfresco/repository/upload/upload.post.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js b/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js index 2a5694f8f9..31d1b112a2 100644 --- a/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js +++ b/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js @@ -309,11 +309,11 @@ function main() return; } + var newFilename = filename; if (updateNameAndMimetype) { //check to see if name is already used in folder - var existingFile = updateNode.getParent().childByNamePath(filename), - newFilename = filename; + var existingFile = updateNode.getParent().childByNamePath(filename); var existingFileNodeRef = (existingFile !== null) ? String(existingFile.nodeRef) : '', updateFileNodeRef = String(updateNodeRef); if (existingFile !== null && existingFileNodeRef !== updateFileNodeRef) @@ -354,7 +354,7 @@ function main() } // 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 // Extract the metadata