London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

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

Vote:
 

Hi,

I have a project that is using EPiCommerce 9.14.1

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

Code:

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.

#157899
Sep 25, 2016 16:31
Vote:
 

Hi,

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.

Regards,

/Q

#157902
Sep 25, 2016 19:01
Vote:
 
#158277
Sep 26, 2016 15:17
Vote:
 
<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>
#158296
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.