Skip to content

Commit 9a96ebf

Browse files
authored
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
1 parent 919b65e commit 9a96ebf

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ public static IUmbracoBuilder AddCoreNotifications(this IUmbracoBuilder builder)
352352
.AddNotificationHandler<ContentSavingNotification, BlockGridPropertyNotificationHandler>()
353353
.AddNotificationHandler<ContentCopyingNotification, BlockGridPropertyNotificationHandler>()
354354
.AddNotificationHandler<ContentScaffoldedNotification, BlockGridPropertyNotificationHandler>()
355+
.AddNotificationHandler<ContentSavingNotification, RichTextPropertyNotificationHandler>()
356+
.AddNotificationHandler<ContentCopyingNotification, RichTextPropertyNotificationHandler>()
357+
.AddNotificationHandler<ContentScaffoldedNotification, RichTextPropertyNotificationHandler>()
355358
.AddNotificationHandler<ContentCopiedNotification, FileUploadPropertyEditor>()
356359
.AddNotificationHandler<ContentDeletedNotification, FileUploadPropertyEditor>()
357360
.AddNotificationHandler<MediaDeletedNotification, FileUploadPropertyEditor>()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) Umbraco.
2+
// See LICENSE for more details.
3+
4+
using Microsoft.Extensions.Logging;
5+
using Umbraco.Cms.Core.Models.Blocks;
6+
7+
namespace Umbraco.Cms.Core.PropertyEditors;
8+
9+
/// <summary>
10+
/// A handler for Rich Text editors used to bind to notifications.
11+
/// </summary>
12+
public class RichTextPropertyNotificationHandler : BlockEditorPropertyNotificationHandlerBase<RichTextBlockLayoutItem>
13+
{
14+
public RichTextPropertyNotificationHandler(ILogger<RichTextPropertyNotificationHandler> logger)
15+
: base(logger)
16+
{
17+
}
18+
19+
protected override string EditorAlias => Constants.PropertyEditors.Aliases.RichText;
20+
}

0 commit comments

Comments
 (0)