EPiServer Commerce 9.14.1 - ContentRepository doesn't always return the latest published version



I have a project that is using EPiCommerce 9.14.1

For some products, ContentRepository doesn't return data from the latest published version.


var productIdFromCommerce = 12345;

var contentRepository = ServiceLocator.Current.GetInstance();
var referenceConverter = ServiceLocator.Current.GetInstance();

var productLink = referenceConverter.GetContentLink(productIdFromCommerce, CatalogContentType.CatalogEntry, 0);
var productContent = contentRepository.Get(productLink);

Let's say the product has versions 1010, 1011, and 1012 available. The code above will return data for version 1010, instead of version 1012.

If I make changes to the product and publish changes (either from CM or the code), ContentRepository returns correct data (from version 1013).

The same code works fine for other products, so I first thought it's a caching issue, but I've restarted IIS several times, cleared cookies, browser data, etc.

Did anyone have the same problem?

A solution that worked for me was to use IContentVersionRepository and always fetch data from the latest published version.

Sep 25, 2016 16:31


If this happens on the lastest version (9.23) Please contact our developer support to file a bug for this. We will make sure it will be taken care of ASAP.



Sep 25, 2016 19:01
Sep 26, 2016 15:17
<p>Hi Quan,</p> <p>I've upgraded EPiServer.Commerce to the latest version but I'm still having the same problem. I've created a new support task. Hope you can push things a bit :)</p>
Sep 26, 2016 21:26
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.