|
@@ -573,9 +573,13 @@ schema.statics.getParentAndFillAncestors = async function(path: string, user, pa
|
|
|
|
|
|
|
|
// find ancestors
|
|
// find ancestors
|
|
|
const builder2 = new PageQueryBuilder(this.find(), true);
|
|
const builder2 = new PageQueryBuilder(this.find(), true);
|
|
|
|
|
+ // avoid including not normalized pages
|
|
|
if (pathsToExcludeNotNormalizedPages != null) {
|
|
if (pathsToExcludeNotNormalizedPages != null) {
|
|
|
builder2.addConditionToFilterByApplicableAncestors(pathsToExcludeNotNormalizedPages);
|
|
builder2.addConditionToFilterByApplicableAncestors(pathsToExcludeNotNormalizedPages);
|
|
|
}
|
|
}
|
|
|
|
|
+ else {
|
|
|
|
|
+ builder2.addConditionToFilterByApplicableAncestors(ancestorPaths);
|
|
|
|
|
+ }
|
|
|
const ancestors = await builder2
|
|
const ancestors = await builder2
|
|
|
.addConditionToListByPathsArray(ancestorPaths)
|
|
.addConditionToListByPathsArray(ancestorPaths)
|
|
|
.addConditionToSortPagesByDescPath()
|
|
.addConditionToSortPagesByDescPath()
|