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 <ronald@barend.se>
This commit is contained in:
@@ -114,8 +114,6 @@ public static class UmbracoBuilderDependencyInjectionExtensions
|
||||
builder.AddInMemoryModelsRazorEngine();
|
||||
|
||||
builder.AddNotificationHandler<ModelBindingErrorNotification, ModelsBuilderNotificationHandler>();
|
||||
builder.AddNotificationHandler<ContentTypeCacheRefresherNotification, OutOfDateModelsStatus>();
|
||||
builder.AddNotificationHandler<DataTypeCacheRefresherNotification, OutOfDateModelsStatus>();
|
||||
}
|
||||
|
||||
if (builder.Config.GetRuntimeMode() != RuntimeMode.Production)
|
||||
@@ -128,12 +126,16 @@ public static class UmbracoBuilderDependencyInjectionExtensions
|
||||
builder.AddNotificationHandler<UmbracoRequestEndNotification, AutoModelsNotificationHandler>();
|
||||
builder.AddNotificationHandler<ContentTypeCacheRefresherNotification, AutoModelsNotificationHandler>();
|
||||
builder.AddNotificationHandler<DataTypeCacheRefresherNotification, AutoModelsNotificationHandler>();
|
||||
|
||||
builder.AddNotificationHandler<ContentTypeCacheRefresherNotification, OutOfDateModelsStatus>();
|
||||
builder.AddNotificationHandler<DataTypeCacheRefresherNotification, OutOfDateModelsStatus>();
|
||||
}
|
||||
|
||||
builder.Services.TryAddSingleton<IModelsBuilderDashboardProvider, NoopModelsBuilderDashboardProvider>();
|
||||
|
||||
// Register required services for ModelsBuilderDashboardController
|
||||
builder.Services.AddSingleton<IModelsGenerator, ModelsGenerator>();
|
||||
|
||||
// TODO: Remove in v13 - this is only here in case someone is already using this generator directly
|
||||
builder.Services.AddSingleton<ModelsGenerator>();
|
||||
builder.Services.AddSingleton<OutOfDateModelsStatus>();
|
||||
@@ -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<IPublishedModelFactory>(factory => factory.CreateDefaultPublishedModelFactory());
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user