Item versioning in umbraco - duplicate versions in one save&publish?
Any idea why do I see two versions of a node when I save and publish?
This is what I do:
1. I change the name of a node
2. Save and publish
3. Check versions in ContentService.Published event and notice there are now two versions with the new name.
I'm trying to compare if a property changed since previous version, but that never seems to work.
I've noticed this as well. What I "think" is happening is that during the Save a version is created, and then during the publish that version is flagged as published and a new version is created ready for any changes.
But, I've not looked into this in lots of detail as it's only recently I've noticed it happening. I'm thinking of spinning up some older versions of v8 to see if the behaviour exists in those as well but it definitely exists in v8.6.
You're probably right, perhaps the last one is a draft on standby.
I'm just trying to compare current version with previous to see if a property has changed, but can't be sure which one is "the previous".
Looks like it's nr. 2 in my screenshot.
Couldn't find some relevant documentation about this.
After a bit more digging, I think the "previous version" can be found by using the VersionId property. So the "previous" version would be the one having VersionId = current.PublishedVersionId - 1.
Item versioning in umbraco - duplicate versions in one save&publish?
Any idea why do I see two versions of a node when I save and publish? This is what I do: 1. I change the name of a node 2. Save and publish 3. Check versions in ContentService.Published event and notice there are now two versions with the new name.
I'm trying to compare if a property changed since previous version, but that never seems to work.
Image screenshot taken from VS debugger:
Any idea what's going on here?
Hi Andrei,
I've noticed this as well. What I "think" is happening is that during the Save a version is created, and then during the publish that version is flagged as published and a new version is created ready for any changes.
But, I've not looked into this in lots of detail as it's only recently I've noticed it happening. I'm thinking of spinning up some older versions of v8 to see if the behaviour exists in those as well but it definitely exists in v8.6.
Thanks,
Nik
Hi Nik,
You're probably right, perhaps the last one is a draft on standby. I'm just trying to compare current version with previous to see if a property has changed, but can't be sure which one is "the previous". Looks like it's nr. 2 in my screenshot. Couldn't find some relevant documentation about this.
Cheers
After a bit more digging, I think the "previous version" can be found by using the VersionId property. So the "previous" version would be the one having VersionId = current.PublishedVersionId - 1.
is working on a reply...