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
This commit is contained in:
Laura Neto
2025-06-12 07:03:49 +02:00
committed by GitHub
parent 919b65ea19
commit 9a96ebf812
2 changed files with 23 additions and 0 deletions

View File

@@ -352,6 +352,9 @@ public static partial class UmbracoBuilderExtensions
.AddNotificationHandler<ContentSavingNotification, BlockGridPropertyNotificationHandler>()
.AddNotificationHandler<ContentCopyingNotification, BlockGridPropertyNotificationHandler>()
.AddNotificationHandler<ContentScaffoldedNotification, BlockGridPropertyNotificationHandler>()
.AddNotificationHandler<ContentSavingNotification, RichTextPropertyNotificationHandler>()
.AddNotificationHandler<ContentCopyingNotification, RichTextPropertyNotificationHandler>()
.AddNotificationHandler<ContentScaffoldedNotification, RichTextPropertyNotificationHandler>()
.AddNotificationHandler<ContentCopiedNotification, FileUploadPropertyEditor>()
.AddNotificationHandler<ContentDeletedNotification, FileUploadPropertyEditor>()
.AddNotificationHandler<MediaDeletedNotification, FileUploadPropertyEditor>()

View File

@@ -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;
/// <summary>
/// A handler for Rich Text editors used to bind to notifications.
/// </summary>
public class RichTextPropertyNotificationHandler : BlockEditorPropertyNotificationHandlerBase<RichTextBlockLayoutItem>
{
public RichTextPropertyNotificationHandler(ILogger<RichTextPropertyNotificationHandler> logger)
: base(logger)
{
}
protected override string EditorAlias => Constants.PropertyEditors.Aliases.RichText;
}