From 4520fbe5b89bf6d6c55542e9cd9ea33af264650d Mon Sep 17 00:00:00 2001 From: Jannik Anker Date: Mon, 16 Oct 2023 10:46:58 +0200 Subject: [PATCH] Out-of-date models status flag is created when using SourceCodeManual and Development Runtime (#14966) * Update UmbracoBuilderDependencyInjectionExtensions.cs * Remove duplicate OutOfDateModelStatus handlers --------- Co-authored-by: Ronald Barendse --- .../UmbracoBuilderDependencyInjectionExtensions.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs b/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs index 818e51aada..20cd35d0d1 100644 --- a/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs +++ b/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs @@ -114,8 +114,6 @@ public static class UmbracoBuilderDependencyInjectionExtensions builder.AddInMemoryModelsRazorEngine(); builder.AddNotificationHandler(); - builder.AddNotificationHandler(); - builder.AddNotificationHandler(); } if (builder.Config.GetRuntimeMode() != RuntimeMode.Production) @@ -128,12 +126,16 @@ public static class UmbracoBuilderDependencyInjectionExtensions builder.AddNotificationHandler(); builder.AddNotificationHandler(); builder.AddNotificationHandler(); + + builder.AddNotificationHandler(); + builder.AddNotificationHandler(); } builder.Services.TryAddSingleton(); // Register required services for ModelsBuilderDashboardController builder.Services.AddSingleton(); + // TODO: Remove in v13 - this is only here in case someone is already using this generator directly builder.Services.AddSingleton(); builder.Services.AddSingleton(); @@ -163,6 +165,7 @@ public static class UmbracoBuilderDependencyInjectionExtensions // This is what the community MB would replace, all of the above services are fine to be registered builder.Services.AddSingleton(factory => factory.CreateDefaultPublishedModelFactory()); + return builder; } }