diff --git a/src/Umbraco.Core/Services/Implement/ContentService.cs b/src/Umbraco.Core/Services/Implement/ContentService.cs index 559faf61e5e0..b190e0c69a00 100644 --- a/src/Umbraco.Core/Services/Implement/ContentService.cs +++ b/src/Umbraco.Core/Services/Implement/ContentService.cs @@ -2200,7 +2200,7 @@ public IContent Copy(IContent content, int parentId, bool relateToOriginal, bool var total = long.MaxValue; while (page * pageSize < total) { - var descendants = GetPagedDescendants(content.Id, page++, pageSize, out total, ordering: Ordering.By("sortOrder")); + var descendants = GetPagedDescendants(content.Id, page++, pageSize, out total); foreach (var descendant in descendants) { // if parent has not been copied, skip, else gets its copy id diff --git a/src/Umbraco.Tests/Services/ContentServiceTests.cs b/src/Umbraco.Tests/Services/ContentServiceTests.cs index 5af4bf6c977a..041dabe7d2fa 100644 --- a/src/Umbraco.Tests/Services/ContentServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentServiceTests.cs @@ -1959,33 +1959,6 @@ public void Can_Copy_Recursive() Assert.AreNotEqual(childCopy.Key, child.Key); } - - [Test] - public void Copy_Recursive_Preserves_Sort_Order() - { - // Arrange - var contentService = ServiceContext.ContentService; - var temp = contentService.GetById(NodeDto.NodeIdSeed + 2); - Assert.AreEqual("Home", temp.Name); - Assert.AreEqual(2, contentService.CountChildren(temp.Id)); - var reversedChildren = contentService.GetPagedChildren(temp.Id, 0, 10, out var total1).Reverse().ToArray(); - contentService.Sort(reversedChildren); - - // Act - var copy = contentService.Copy(temp, temp.ParentId, false, true, Constants.Security.SuperUserId); - var content = contentService.GetById(NodeDto.NodeIdSeed + 2); - - // Assert - Assert.That(copy, Is.Not.Null); - Assert.That(copy.Id, Is.Not.EqualTo(content.Id)); - Assert.AreNotSame(content, copy); - Assert.AreEqual(2, contentService.CountChildren(copy.Id)); - - var copiedChildren = contentService.GetPagedChildren(copy.Id, 0, 10, out var total2).OrderBy(c => c.SortOrder).ToArray(); - Assert.AreEqual(reversedChildren.First().Name, copiedChildren.First().Name); - Assert.AreEqual(reversedChildren.Last().Name, copiedChildren.Last().Name); - } - [Test] public void Can_Copy_NonRecursive() {