From 88a2878cf2d231354609f003351caf9ab211d06f Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Tue, 12 Feb 2019 14:48:49 +1100 Subject: [PATCH 1/3] Removing ClientDependency setup for non-web runtimes --- src/Umbraco.Web/Runtime/WebRuntimeComponent.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs index 123cb952d7..ff96963c2f 100644 --- a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs +++ b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs @@ -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 (HttpContext.Current != null) + ClientDependencySettings.Instance.MvcRendererCollection.Add(renderer); } } } From c50daf87a5fe7109575297073bbade9cced6265d Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Thu, 14 Feb 2019 13:44:24 +1100 Subject: [PATCH 2/3] Moving to using IOHelper.IsHosted --- src/Umbraco.Web/Runtime/WebRuntimeComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs index ff96963c2f..a7de6ca842 100644 --- a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs +++ b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs @@ -280,7 +280,7 @@ namespace Umbraco.Web.Runtime // 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 (HttpContext.Current != null) + if (IOHelper.IsHosted) ClientDependencySettings.Instance.MvcRendererCollection.Add(renderer); } } From 94cb6cb66843f0fb435f62ea0afa69d76a5e14ef Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 14 Feb 2019 08:03:00 +0100 Subject: [PATCH 3/3] Bugfix NuCache #4547 --- .../PublishedCache/NuCache/ContentNodeKit.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentNodeKit.cs b/src/Umbraco.Web/PublishedCache/NuCache/ContentNodeKit.cs index 739a6141be..753ba5cc94 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/ContentNodeKit.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/ContentNodeKit.cs @@ -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); } } }