From 685b8674568a5cc14872fa50d99998795b6fcaef Mon Sep 17 00:00:00 2001 From: Nikolaj Brask-Nielsen Date: Fri, 11 Aug 2023 22:32:32 +0200 Subject: [PATCH] fix: Pass correct user id to Audit log --- src/Umbraco.Core/Services/ContentService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 7111b2aca2..7a72bb1f8d 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1097,7 +1097,8 @@ public class ContentService : RepositoryService, IContentService scope.Notifications.Publish( new ContentTreeChangeNotification(contentsA, TreeChangeTypes.RefreshNode, eventMessages)); - Audit(AuditType.Save, userId == -1 ? 0 : userId, Constants.System.Root, "Saved multiple content"); + string contentIds = string.Join(", ", contentsA.Select(x => x.Id)); + Audit(AuditType.Save, userId, Constants.System.Root, $"Saved multiple content items ({contentIds})"); scope.Complete(); } @@ -2820,7 +2821,7 @@ public class ContentService : RepositoryService, IContentService } else { - Audit(AuditType.SendToPublish, content.WriterId, content.Id); + Audit(AuditType.SendToPublish, userId, content.Id); } return saveResult.Success; @@ -3562,7 +3563,7 @@ public class ContentService : RepositoryService, IContentService _documentBlueprintRepository.Save(content); - Audit(AuditType.Save, Constants.Security.SuperUserId, content.Id, $"Saved content template: {content.Name}"); + Audit(AuditType.Save, userId, content.Id, $"Saved content template: {content.Name}"); scope.Notifications.Publish(new ContentSavedBlueprintNotification(content, evtMsgs));