From 1bd5127bcf6d05b2f38a0c0121ae1e399c6ae63c Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 15 Jan 2019 17:27:18 +0100 Subject: [PATCH 1/4] Actually run HealthCheck notifier --- src/Umbraco.Web/Scheduling/SchedulerComponent.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web/Scheduling/SchedulerComponent.cs b/src/Umbraco.Web/Scheduling/SchedulerComponent.cs index e4bc74b7f2..cd4f5ac933 100644 --- a/src/Umbraco.Web/Scheduling/SchedulerComponent.cs +++ b/src/Umbraco.Web/Scheduling/SchedulerComponent.cs @@ -149,6 +149,7 @@ namespace Umbraco.Web.Scheduling var periodInMilliseconds = healthCheckConfig.NotificationSettings.PeriodInHours * 60 * 60 * 1000; var task = new HealthCheckNotifier(_healthCheckRunner, delayInMilliseconds, periodInMilliseconds, healthChecks, notifications, _runtime, logger); + _healthCheckRunner.TryAdd(task); return task; } From 477075662163857ba32cea0a4989f1ab9438f7f4 Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 15 Jan 2019 18:41:02 +0100 Subject: [PATCH 2/4] Bugfix ContentCacheRefresher --- src/Umbraco.Web/Cache/ContentCacheRefresher.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web/Cache/ContentCacheRefresher.cs b/src/Umbraco.Web/Cache/ContentCacheRefresher.cs index 22f1554269..b0192e9e75 100644 --- a/src/Umbraco.Web/Cache/ContentCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ContentCacheRefresher.cs @@ -44,16 +44,14 @@ namespace Umbraco.Web.Cache public override void Refresh(JsonPayload[] payloads) { - var runtimeCache = Current.ApplicationCache.RuntimeCache; - - runtimeCache.ClearCacheObjectTypes(); + CacheHelper.RuntimeCache.ClearCacheObjectTypes(); var idsRemoved = new HashSet(); + var isolatedCache = CacheHelper.IsolatedRuntimeCache.GetOrCreateCache(); foreach (var payload in payloads) { - // remove that one - runtimeCache.ClearCacheItem(RepositoryCacheKeys.GetKey(payload.Id)); + isolatedCache.ClearCacheItem(RepositoryCacheKeys.GetKey(payload.Id)); _idkMap.ClearCache(payload.Id); @@ -61,7 +59,7 @@ namespace Umbraco.Web.Cache if (payload.ChangeTypes.HasTypesAny(TreeChangeTypes.RefreshBranch | TreeChangeTypes.Remove)) { var pathid = "," + payload.Id + ","; - runtimeCache.ClearCacheObjectTypes((k, v) => v.Path.Contains(pathid)); + isolatedCache.ClearCacheObjectTypes((k, v) => v.Path.Contains(pathid)); } //if the item is being completely removed, we need to refresh the domains cache if any domain was assigned to the content From eb3d3e129c8a96583155239a85efacd1b825199f Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 15 Jan 2019 19:15:06 +0100 Subject: [PATCH 3/4] Bugfix package service --- src/Umbraco.Core/Services/Implement/PackagingService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Services/Implement/PackagingService.cs b/src/Umbraco.Core/Services/Implement/PackagingService.cs index 8f6c287cf1..99ee7a098b 100644 --- a/src/Umbraco.Core/Services/Implement/PackagingService.cs +++ b/src/Umbraco.Core/Services/Implement/PackagingService.cs @@ -579,7 +579,7 @@ namespace Umbraco.Core.Services.Implement contentType.IsContainer = isListView.Value.InvariantEquals("true"); var isElement = infoElement.Element("IsElement"); - if (isListView != null) + if (isElement != null) contentType.IsElement = isElement.Value.InvariantEquals("true"); //Name of the master corresponds to the parent and we need to ensure that the Parent Id is set From d4edbc8e791a9d944c737e0882b973672787147a Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 15 Jan 2019 19:38:52 +0100 Subject: [PATCH 4/4] Fix tests --- .../PublishedContent/PublishedContentTests.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index ab65ac82b1..603464e18b 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -69,8 +69,9 @@ namespace Umbraco.Tests.PublishedContent factory.CreatePropertyType("testRecursive", 1), }; var compositionAliases = new[] { "MyCompositionAlias" }; - var type = new AutoPublishedContentType(0, "anything", compositionAliases, propertyTypes); - ContentTypesCache.GetPublishedContentTypeByAlias = alias => type; + var anythingType = new AutoPublishedContentType(0, "anything", compositionAliases, propertyTypes); + var homeType = new AutoPublishedContentType(0, "home", compositionAliases, propertyTypes); + ContentTypesCache.GetPublishedContentTypeByAlias = alias => alias.InvariantEquals("home") ? homeType : anythingType; } protected override TypeLoader CreateTypeLoader(IRuntimeCacheProvider runtimeCache, IGlobalSettings globalSettings, IProfilingLogger logger) @@ -236,6 +237,7 @@ namespace Umbraco.Tests.PublishedContent public void Is_Last_From_Where_Filter2() { var doc = GetNode(1173); + var ct = doc.ContentType; var items = doc.Children .Select(x => x.CreateModel()) // linq, returns IEnumerable @@ -454,11 +456,11 @@ namespace Umbraco.Tests.PublishedContent { var doc = GetNode(1046); // has child nodes - var model = doc.FirstChild(x => true); // predicate + var model = doc.FirstChild(x => true); // predicate Assert.IsNotNull(model); Assert.IsTrue(model.Id == 1173); - Assert.IsInstanceOf(model); + Assert.IsInstanceOf(model); Assert.IsInstanceOf(model); doc = GetNode(1175); // does not have child nodes