Merge branch 'v8/dev' into v8-feature-nc-copy-all

This commit is contained in:
Kenn Jacobsen
2019-06-22 10:21:54 +02:00
6 changed files with 28 additions and 20 deletions

View File

@@ -2,9 +2,9 @@
namespace Umbraco.Core.Services.Changes
{
internal static class TreeChangeExtensions
public static class TreeChangeExtensions
{
public static TreeChange<TItem>.EventArgs ToEventArgs<TItem>(this IEnumerable<TreeChange<TItem>> changes)
internal static TreeChange<TItem>.EventArgs ToEventArgs<TItem>(this IEnumerable<TreeChange<TItem>> changes)
{
return new TreeChange<TItem>.EventArgs(changes);
}

View File

@@ -1695,12 +1695,11 @@ namespace Umbraco.Core.Services.Implement
}
const int pageSize = 500;
var page = 0;
var total = long.MaxValue;
while (page * pageSize < total)
while (total > 0)
{
//get descendants - ordered from deepest to shallowest
var descendants = GetPagedDescendants(content.Id, page, pageSize, out total, ordering: Ordering.By("Path", Direction.Descending));
var descendants = GetPagedDescendants(content.Id, 0, pageSize, out total, ordering: Ordering.By("Path", Direction.Descending));
foreach (var c in descendants)
DoDelete(c);
}
@@ -1926,11 +1925,10 @@ namespace Umbraco.Core.Services.Implement
paths[content.Id] = (parent == null ? (parentId == Constants.System.RecycleBinContent ? "-1,-20" : Constants.System.RootString) : parent.Path) + "," + content.Id;
const int pageSize = 500;
var page = 0;
var total = long.MaxValue;
while (page * pageSize < total)
while (total > 0)
{
var descendants = GetPagedDescendantsLocked(originalPath, page++, pageSize, out total, null, Ordering.By("Path", Direction.Ascending));
var descendants = GetPagedDescendantsLocked(originalPath, 0, pageSize, out total, null, Ordering.By("Path", Direction.Ascending));
foreach (var descendant in descendants)
{
moves.Add(Tuple.Create(descendant, descendant.Path)); // capture original path