+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Workflow and Versioning bug

Workflow and Versioning bug

5 posts, 0 answered
  1. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    05 Dec 2007
    Link to this post
    Here's another one.
     
    You set allowWorkflow=true, allowVersioning=false on GenericContent.
    Create and publish a new item. It's version is one.
    Click edit, save. It's version is two.
    Click edit and save again, it's three.
    Click edit and save again, it's four.
    Then go and publish it, the version is set to three.

    Shouldn't the version be set to one since allowVersioning is set to false?

    Thanks,
    Eric
  2. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    06 Dec 2007
    Link to this post
    Hello Eric,

    Could you please tell us which version are you using? We tested this with SP2 and found no other erroneous behavior apart from the History tab first showing and then disappearing when clicked.
    Here is what we did:
    1.Set allowWorkflow=true, allowVersioning=false for the Generic Content module.
    2. Created and published an item.
    3. Clicked the History tab. The tab disappears. No information about the version of the item is displayed.
    Do tell us what we are doing/setting differently.

    Regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    06 Dec 2007
    Link to this post
    You have to look at the sf_VersionItem table. When you create a new GenericContent item, there is an entry in the sf_VersionItem table for this item. Every time you go to edit this item, before you publish, the version number is incremented and another entry in the sf_VersionItem table is made. After editing say three times, your version should be four. At this point if you publish the item, the version is now set to three.

    From digging into the code, it seems that the problem is in the CommitChanges method in Telerik.Versioning.Data.DefaultProvider. Here, the current item is being set as (IVersionItem) newItem. Another member orgItem, also IVersionItem, is being set as the current version -1. So in our scenario, newItem is version four and orgItem is version three. It then deletes version four and saves the data for version four as version three. So the end result is a published item with a version one less than the last version created.

    We have been extending the GenericContent module and using the version number along with the item Guid to store the different versions. This way as you roll back an item, we can retrieve the appropriate data for the version rolled back to. This is a problem with the publishing when versioning is set to false and workflow is set to true. As I mentioned above, before you publish everything works just fine. Each edit gives you a new version number. The problem is that when you publish and the last version number is decremented by one, the versioning is no longer correct. If in the example above we save data using the version four and on publish the actual GenericContent item's version is set back to three, then our data does not match up.

    This problem only seems to occur when the versioning is set to false and the workflow is set to true. If both are set to false or both are set to true, then everything seems to work without any problems. If versioning is set to false, then the version number should never be incremented.
  4. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    07 Dec 2007
    Link to this post
    When we reported the bug it was SP1, but the same behavior occurs in SP2.
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    10 Dec 2007
    Link to this post
    Hi Richard,

    Thanks a lot for the detailed explanation of the problem. We managed to reproduce this issue locally and it is already fixed. The fix will be available in the next release.

    Thanks for your involvement, your Telerik account has been updated for reporting this.


    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
5 posts, 0 answered