From 449d534701b0728e34034ae0b389495cd47331c5 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 16 Mar 2020 19:00:18 +0100 Subject: [PATCH] Fix buf in Healthchecksettings --- .../Models/HealthChecksSettingsSettings.cs | 9 +++++++-- .../UmbracoBackOfficeServiceCollectionExtensions.cs | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Configuration/Models/HealthChecksSettingsSettings.cs b/src/Umbraco.Configuration/Models/HealthChecksSettingsSettings.cs index 300a54fb75..ab00dbcb46 100644 --- a/src/Umbraco.Configuration/Models/HealthChecksSettingsSettings.cs +++ b/src/Umbraco.Configuration/Models/HealthChecksSettingsSettings.cs @@ -48,8 +48,13 @@ namespace Umbraco.Configuration.Models .GetChildren() .ToDictionary(x=>x.Key, x=> (INotificationMethod) new NotificationMethod(x.Key, x)); - public IEnumerable DisabledChecks => - _configurationSection.GetValue("DisabledChecks", Array.Empty()); + public IEnumerable DisabledChecks => _configurationSection.GetSection("DisabledChecks").GetChildren().Select( + x => new DisabledHealthCheck() + { + Id = x.GetValue("Id"), + DisabledOn = x.GetValue("DisabledOn"), + DisabledBy = x.GetValue("DisabledBy"), + }); } private class NotificationMethod : INotificationMethod diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeServiceCollectionExtensions.cs b/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeServiceCollectionExtensions.cs index 91df6fee3f..9010979507 100644 --- a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeServiceCollectionExtensions.cs +++ b/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeServiceCollectionExtensions.cs @@ -7,6 +7,7 @@ using Umbraco.Composing; using Umbraco.Configuration; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; +using Umbraco.Core.Configuration.HealthChecks; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Logging.Serilog; @@ -29,7 +30,9 @@ namespace Umbraco.Web.BackOffice.AspNetCore var configsFactory = new AspNetCoreConfigsFactory(configuration); var configs = configsFactory.Create(); - var settings = configs.GetConfig(); + var settings = configs.GetConfig(); + + services.CreateCompositionRoot( httpContextAccessor,