OriginalContentId can be and Empty Guid??
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
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.
I'm confused...no these products are *ALL* published and live...
They're showing up in the webservice and everything
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:
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)
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.