Cleanup NuCache/PublishedContent

This commit is contained in:
Stephan
2019-01-28 14:15:47 +01:00
parent 85d4b4a61d
commit 9b4b8b9d86
5 changed files with 33 additions and 26 deletions

View File

@@ -243,7 +243,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
var n = _snapshot.Get(contentId);
if (n == null) return false;
return preview || n.Published != null;
return preview || n.PublishedModel != null;
}
public override IEnumerable<IPublishedContent> GetAtRoot(bool preview)
@@ -280,8 +280,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
// both .Draft and .Published cannot be null at the same time
return preview
? node.Draft ?? GetPublishedContentAsDraft(node.Published)
: node.Published;
? node.DraftModel ?? GetPublishedContentAsDraft(node.PublishedModel)
: node.PublishedModel;
}
// gets a published content as a previewing draft, if preview is true
@@ -302,7 +302,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
{
return preview
? _snapshot.IsEmpty == false
: _snapshot.GetAtRoot().Any(x => x.Published != null);
: _snapshot.GetAtRoot().Any(x => x.PublishedModel != null);
}
#endregion