Changed the logic of the GetByPublishedVersion to only return from cache if the cache item is published.

This commit is contained in:
Shannon
2013-07-29 16:03:37 +10:00
parent b9ba350a2f
commit 55c68485e9

View File

@@ -449,8 +449,12 @@ namespace Umbraco.Core.Persistence.Repositories
foreach (var dto in dtos)
{
//Check in the cache first. If it exists there AND it is published
// then we can use that entity. Otherwise if it is not published (which can be the case
// because we only store the 'latest' entries in the cache which might not be the published
// version)
var fromCache = TryGetFromCache(dto.NodeId);
if (fromCache.Success)
if (fromCache.Success && fromCache.Result.Published)
{
yield return fromCache.Result;
}