Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions uSync.BackOffice/SyncHandlers/Handlers/ContentHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,35 @@ protected override Task<bool> HasChildrenAsync(IContent item)
protected override IEnumerable<IEntity> GetRootItems()
=> _contentService.GetRootContent();

/// <inheritdoc />
protected override async Task<IEnumerable<IEntity>> GetChildItemsAsync(IEntity? parent)
{
if (parent != null)
{
var items = new List<IContent>();
const int pageSize = 5000;
var page = 0;
var total = long.MaxValue;
while (page * pageSize < total)
{
items.AddRange(_contentService.GetPagedChildren(
id: parent.Id,
pageIndex: page++,
pageSize: pageSize,
totalRecords: out total,
propertyAliases: null,
filter: null,
ordering: null,
loadTemplates: true));
}
return items;
}
else
{
return await Task.FromResult(GetRootItems());
}
}

/// <summary>
/// Handle the publish events for content
/// </summary>
Expand Down
9 changes: 4 additions & 5 deletions uSync.BackOffice/uSyncBackOfficeComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ public class uSyncBackOfficeComposer : IComposer
/// <inheritdoc/>
public void Compose(IUmbracoBuilder builder)
{
// uSync core will actually run when their is no back office loaded.
//if (builder.IsUmbracoBackOfficeEnabled() is false)
// return;

builder.AdduSync();
if (builder.IsUmbracoBackOfficeEnabled() is true)
{
builder.AdduSync();
}
}
}
Loading