When someone uploads a document of the same name as a file already in the repository, I want to update that file's content to the new file's content.
var current = destination.childByNamePath(document.name);
if(current != null) {
var workingCopy = current.checkout();
workingCopy.properties.content.write(document.properties.content);
workingCopy.checkin();
}
When I do this, I get:
10:01:56,744 ERROR [STDERR] Caused by: org.alfresco.service.cmr.version.VersionServiceException: The current version label of the node does not exist in the version history.
We have versioning enabled and the node has the versionable aspect.