From 9a96ebf81215d184d6c4a435150de6bd0db61ca6 Mon Sep 17 00:00:00 2001 From: Laura Neto <12862535+lauraneto@users.noreply.github.com> Date: Thu, 12 Jun 2025 07:03:49 +0200 Subject: [PATCH] Replace keys in Rich Text Editor blocks on clone operations (#19526) * Regenerate keys in RTE blocks on clone operations This was already present for BlockList and BlockGrid, but not Blocks in RTE. * Small adjustment from code review --- .../UmbracoBuilder.CoreServices.cs | 3 +++ .../RichTextPropertyNotificationHandler.cs | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyNotificationHandler.cs diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs index 0e4e6fdb42..56fdface93 100644 --- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs +++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs @@ -352,6 +352,9 @@ public static partial class UmbracoBuilderExtensions .AddNotificationHandler() .AddNotificationHandler() .AddNotificationHandler() + .AddNotificationHandler() + .AddNotificationHandler() + .AddNotificationHandler() .AddNotificationHandler() .AddNotificationHandler() .AddNotificationHandler() diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyNotificationHandler.cs b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyNotificationHandler.cs new file mode 100644 index 0000000000..5f07c8342d --- /dev/null +++ b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyNotificationHandler.cs @@ -0,0 +1,20 @@ +// Copyright (c) Umbraco. +// See LICENSE for more details. + +using Microsoft.Extensions.Logging; +using Umbraco.Cms.Core.Models.Blocks; + +namespace Umbraco.Cms.Core.PropertyEditors; + +/// +/// A handler for Rich Text editors used to bind to notifications. +/// +public class RichTextPropertyNotificationHandler : BlockEditorPropertyNotificationHandlerBase +{ + public RichTextPropertyNotificationHandler(ILogger logger) + : base(logger) + { + } + + protected override string EditorAlias => Constants.PropertyEditors.Aliases.RichText; +}