Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrei 15 posts 99 karma points
    Jun 12, 2020 @ 16:02
    Andrei
    0

    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:

    enter image description here

    Any idea what's going on here?

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Jun 12, 2020 @ 21:18
    Nik
    0

    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

  • Andrei 15 posts 99 karma points
    Jun 13, 2020 @ 11:56
    Andrei
    0

    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

  • Andrei 15 posts 99 karma points
    Jun 13, 2020 @ 12:28
    Andrei
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft