Merge branch 'u4-5003' of https://github.com/AndyButland/Umbraco-CMS into 7.2.0
This commit is contained in:
@@ -486,6 +486,8 @@ namespace Umbraco.Core.Services
|
||||
public IEnumerable<IContent> GetPagedChildren(int id, int pageNumber, int pageSize, out int totalChildren,
|
||||
string orderBy, Direction orderDirection, string filter = "")
|
||||
{
|
||||
Mandate.ParameterCondition(pageNumber > 0, "pageSize");
|
||||
Mandate.ParameterCondition(pageSize > 0, "pageSize");
|
||||
using (var repository = _repositoryFactory.CreateContentRepository(_uowProvider.GetUnitOfWork()))
|
||||
{
|
||||
var query = Query<IContent>.Builder.Where(x => x.ParentId == id);
|
||||
|
||||
@@ -158,7 +158,16 @@ namespace Umbraco.Web.Editors
|
||||
string filter = "")
|
||||
{
|
||||
int totalChildren;
|
||||
var children = Services.ContentService.GetPagedChildren(id, pageNumber, pageSize, out totalChildren, orderBy, orderDirection, filter).ToArray();
|
||||
IContent[] children;
|
||||
if (pageNumber > 0 && pageSize > 0)
|
||||
{
|
||||
children = Services.ContentService.GetPagedChildren(id, pageNumber, pageSize, out totalChildren, orderBy, orderDirection, filter).ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
children = Services.ContentService.GetChildren(id).ToArray();
|
||||
totalChildren = children.Length;
|
||||
}
|
||||
|
||||
if (totalChildren == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user