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

Forums / Ecommerce / OriginalContentId can be and Empty Guid??

OriginalContentId can be and Empty Guid??

6 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    24 May 2013
    Link to this post
    I have a randomizer that gets all products, picks one, then returns it, and stores the OriginalContentId in a table....which is then retrieved later with GetProduct.

    So...I find the item, and store it, but the problem is 

    1) The OriginalContentId is == Guid.Empty
    2) GetProduct throws an exception that you can't give it an empty Guid

    ??
  2. Boyko Nistorov
    Boyko Nistorov avatar
    16 posts
    Registered:
    17 Oct 2016
    28 May 2013
    Link to this post
    Hi Steve,

     OriginalContentId holds the linkage between item's lifecycle versions (Live, Temp objects linked to Master one).

    If OriginalContentId is Guid.Empty, that means that the item is in Master status.
    If OriginalContentId has a non empty Guid value, this means that there is another item (Master), which Id is equal to the OriginalContentId value.

    You can add filtration to your randomizer by Status.

    Let me know if this helps you resolve the problem.

    Regards,
    Boyko Nistorov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    01 Jun 2013 in reply to Boyko Nistorov
    Link to this post
    I'm confused...no these products are *ALL* published and live...

    They're showing up in the webservice and everything
  4. Ivan Eftimov
    Ivan Eftimov avatar
    23 posts
    Registered:
    20 Jul 2016
    03 Jun 2013
    Link to this post
    Hi Steve,

     Although all the products are published and live, they will still have a master version of the item, which means you will have items with OriginalContentId == Guid.Empty as many as you have actual items (live + draft). 
    Make sure that you check the for ContentLyfecycle.Live and  for Visible == true in the query. Following is an example:

    var products = dynamicModuleManager.GetDataItems(carType).Where(i => i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && i.Visible == true);
    You can find out more about the sitefinity content life cycle if you follow this link.  
    Do not hesitate to write us if any other issue arises.

    Regards,
    Ivan Eftimov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    03 Jun 2013 in reply to Ivan Eftimov
    Link to this post
    Yeah, I'm familiar with the lifecycle...but the OriginalConentId is the never changing ID that exists on the master, live, and draft items right...the one id that always lets you get to the item.

    So now with eComm, thats a guid.empty for me on a ton of products, and you can't even call GetProduct i believe because it throws a can't query with guid.empty exception.

    So like if I store a link to the ID of a live item...then go change that item such that it goes through another publish cycle...the Live ID changes....right?  So that ID I have stored returns nothing...which is why we have the OriginalcontentID (I thought)
  6. Ivan Eftimov
    Ivan Eftimov avatar
    23 posts
    Registered:
    20 Jul 2016
    04 Jun 2013
    Link to this post
    Hi Steve,

     OriginalContentId is actually the Id of the master item. It is the connection of live and temp items with the master item. So, live and temp items have OriginalcontentId == Id of the master item. 
    Master item, on the other hand, has an OriginalContentId == Guid.Empty, i.e. them master item is the actual original content.

    Moreover, the Id of the live item does not change if it goes through another publish cycle.

    About your case, I suggest you to get the live items and store their Id instead of the OriginalContentId. Later you can retrieve these items by that Id. 

    If this does not help, please send your code so we can inspect it in details and figure out the best approach of the problem.

    Regards,
    Ivan Eftimov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
6 posts, 0 answered