Bugfix NuCache #4547

This commit is contained in:
Stephan
2019-02-14 08:03:00 +01:00
parent 7e9d8e5de8
commit 94cb6cb668

View File

@@ -24,7 +24,18 @@ namespace Umbraco.Web.PublishedCache.NuCache
bool canBePublished,
IUmbracoContextAccessor umbracoContextAccessor)
{
Node.SetContentTypeAndData(contentType, DraftData, canBePublished ? PublishedData : null, publishedSnapshotAccessor, variationContextAccessor,umbracoContextAccessor);
var draftData = DraftData;
// no published data if it cannot be published (eg is masked)
var publishedData = canBePublished ? PublishedData : null;
// we *must* have either published or draft data
// if it cannot be published, published data is going to be null
// therefore, ensure that draft data is not
if (draftData == null && !canBePublished)
draftData = PublishedData;
Node.SetContentTypeAndData(contentType, draftData, publishedData, publishedSnapshotAccessor, variationContextAccessor,umbracoContextAccessor);
}
}
}