From b00c84a36abc6fb685decc1d7e4bbf1b064a3053 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 12 Nov 2024 12:23:53 +0100 Subject: [PATCH] Revert "sort the children of a parent content after either deleting or moving its child content (#17315)" This reverts commit 6705de032977360107397f5903948035a3bbdd85. --- src/Umbraco.Core/Services/ContentService.cs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 8fbc8c8305..08147a48a9 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -2406,8 +2406,6 @@ public class ContentService : RepositoryService, IContentService using (ICoreScope scope = ScopeProvider.CreateCoreScope()) { - var parentId = content.ParentId; - scope.WriteLock(Constants.Locks.ContentTree); var originalPath = content.Path; @@ -2440,14 +2438,6 @@ public class ContentService : RepositoryService, IContentService movingToRecycleBinNotification)); Audit(AuditType.Move, userId, content.Id, "Moved to recycle bin"); - // sort the children of the parent after deleting the content - IQuery childQuery = Query().Where(x => x.ParentId == parentId && x.Id != content.Id); - IEnumerable children = _documentRepository.Get(childQuery); - if(children.Any()) - { - Sort(children, userId); - } - scope.Complete(); } @@ -2469,8 +2459,6 @@ public class ContentService : RepositoryService, IContentService { EventMessages eventMessages = EventMessagesFactory.Get(); - var parentIdBeforeMove = content.ParentId; - if (content.ParentId == parentId) { return OperationResult.Succeed(eventMessages); @@ -2535,14 +2523,6 @@ public class ContentService : RepositoryService, IContentService Audit(AuditType.Move, userId, content.Id); - // sort the children of the old parent after moving the content - IQuery childQuery = Query().Where(x => x.ParentId == parentIdBeforeMove && x.Id != content.Id); - IEnumerable children = _documentRepository.Get(childQuery); - if (children.Any()) - { - Sort(children, userId); - } - scope.Complete(); return OperationResult.Succeed(eventMessages); }