ContentService.GetPagedChildren should also only get children

This commit is contained in:
Emil Wangaa
2017-03-03 14:15:04 +01:00
parent 56da13fa79
commit 0f535f233e
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -578,11 +578,9 @@ namespace Umbraco.Core.Services
var repository = RepositoryFactory.CreateContentRepository(uow);
var query = Query<IContent>.Builder;
//if the id is System Root, then just get all
if (id != Constants.System.Root)
{
query.Where(x => x.ParentId == id);
}
// always check for a parent - else it will also get decendants (and then you should use the GetPagedDescendants method)
query.Where(x => x.ParentId == id);
IQuery<IContent> filterQuery = null;
if (filter.IsNullOrWhiteSpace() == false)
{
+1 -1
View File
@@ -457,7 +457,7 @@ namespace Umbraco.Core.Services
var repository = RepositoryFactory.CreateMediaRepository(uow);
var query = Query<IMedia>.Builder;
// always check for a parent - else it will also get decendants
// always check for a parent - else it will also get decendants (and then you should use the GetPagedDescendants method)
query.Where(x => x.ParentId == id);
IQuery<IMedia> filterQuery = null;