Revert "sort the children of a parent content after either deleting or moving its child content (#17315)"

This reverts commit 6705de0329.
This commit is contained in:
Sebastiaan Janssen
2024-11-12 12:23:53 +01:00
parent 178c5dcb83
commit b00c84a36a

View File

@@ -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<IContent> childQuery = Query<IContent>().Where(x => x.ParentId == parentId && x.Id != content.Id);
IEnumerable<IContent> 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<IContent> childQuery = Query<IContent>().Where(x => x.ParentId == parentIdBeforeMove && x.Id != content.Id);
IEnumerable<IContent> children = _documentRepository.Get(childQuery);
if (children.Any())
{
Sort(children, userId);
}
scope.Complete();
return OperationResult.Succeed(eventMessages);
}