diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index be81292bb0..ec69f7d5f5 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -486,6 +486,8 @@ namespace Umbraco.Core.Services public IEnumerable 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.Builder.Where(x => x.ParentId == id); diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index b9cb9d07a2..87a7340169 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -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) {