cancel
Showing results for 
Search instead for 
Did you mean: 

Content checkin exception

joshaber
Champ on-the-rise
Champ on-the-rise
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.
2 REPLIES 2

joshaber
Champ on-the-rise
Champ on-the-rise
The problem was that we had a custom content type whose parent was cm:content. In our custom type, we added cm:versionable as a mandatory aspect but apparently that doesn't work? We added cm:versionable as a mandatory aspect in cm:content and it now works.

dwilson
Champ in-the-making
Champ in-the-making
(on Community 2.9B)
I periodically receive the same error exception.
I also have a subtype "MyContentType" that has cm:versionable as a mandatory aspect and extends from cm:common.

Although- my method to receive the error is slightly different:
My space has a rule to specialise to my custom content type.

a) If I create new content of type "MyContentType" immediately using the first type dropdown, then I receive no error.

b) If I create new content of type "Content" in order to let the specialise rule kick in convert it to MyContentType, then I receive the error and am not allowed to get past the modify properties page.  I can still see the content later, and the Version Label is blank (instead of the default "1.1" when using (a) above.)

Adding in the above post, there seem to be two work-arounds that are both undesirable:

w1) Remove the specialise rule and train my staff to always manually choose "MyContentType" when creating new content there

w2) Remove the versionable aspect from MyContentType and add it onto cm:content by editing the system config file.

Is there not a better way?  This gentleman posted the same problem years ago with yet another unanswered thread:   http://forums.alfresco.com/en/viewtopic.php?f=5&t=4818&start=0&st=0&sk=t&sd=a