Merge branch 'temp8' of https://github.com/umbraco/Umbraco-CMS into temp8

This commit is contained in:
Shannon
2019-02-14 18:25:07 +11:00
2 changed files with 16 additions and 2 deletions

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);
}
}
}

View File

@@ -278,7 +278,10 @@ namespace Umbraco.Web.Runtime
{ "compositeFileHandlerPath", ClientDependencySettings.Instance.CompositeFileHandlerPath }
});
ClientDependencySettings.Instance.MvcRendererCollection.Add(renderer);
// When using a non-web runtime and this component is loaded ClientDependency explodes because it'll
// want to access HttpContext.Current, which doesn't exist
if (IOHelper.IsHosted)
ClientDependencySettings.Instance.MvcRendererCollection.Add(renderer);
}
}
}