From d31a9859b2d4b375d5cf9e3610d5b682710fa678 Mon Sep 17 00:00:00 2001 From: Mole Date: Fri, 16 Apr 2021 14:51:56 +0200 Subject: [PATCH] Make DatabaseSchema notifications stateful --- src/Umbraco.Core/Events/CancelableNotification.cs | 2 +- .../Migrations/Events/DatabaseSchemaCreatedNotification.cs | 2 +- .../Migrations/Install/DatabaseSchemaCreator.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Events/CancelableNotification.cs b/src/Umbraco.Core/Events/CancelableNotification.cs index 86849b031b..c464d5fabc 100644 --- a/src/Umbraco.Core/Events/CancelableNotification.cs +++ b/src/Umbraco.Core/Events/CancelableNotification.cs @@ -1,6 +1,6 @@ namespace Umbraco.Cms.Core.Events { - public class CancelableNotification : ICancelableNotification + public class CancelableNotification : StatefulNotification, ICancelableNotification { public bool Cancel { get; set; } public void CancelOperation() diff --git a/src/Umbraco.Infrastructure/Migrations/Events/DatabaseSchemaCreatedNotification.cs b/src/Umbraco.Infrastructure/Migrations/Events/DatabaseSchemaCreatedNotification.cs index 2fda8b4936..41d0a5a128 100644 --- a/src/Umbraco.Infrastructure/Migrations/Events/DatabaseSchemaCreatedNotification.cs +++ b/src/Umbraco.Infrastructure/Migrations/Events/DatabaseSchemaCreatedNotification.cs @@ -2,7 +2,7 @@ using Umbraco.Cms.Core.Events; namespace Umbraco.Cms.Infrastructure.Migrations.Events { - internal class DatabaseSchemaCreatedNotification : INotification + internal class DatabaseSchemaCreatedNotification : StatefulNotification { } diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs index 3ae86776f5..799cd08654 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs @@ -146,7 +146,8 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install CreateTable(false, table, dataCreation); } - FireAfterCreation(new DatabaseSchemaCreatedNotification()); + DatabaseSchemaCreatedNotification createdNotification = new DatabaseSchemaCreatedNotification().WithStateFrom(creatingNotification); + FireAfterCreation(createdNotification); } ///