|
@@ -1381,6 +1381,7 @@ class PageService {
|
|
|
|
|
|
|
|
const revertDeletedDescendants = this.revertDeletedDescendants.bind(this);
|
|
const revertDeletedDescendants = this.revertDeletedDescendants.bind(this);
|
|
|
const normalizeParentRecursively = this.normalizeParentRecursively.bind(this);
|
|
const normalizeParentRecursively = this.normalizeParentRecursively.bind(this);
|
|
|
|
|
+ const shouldNormalizeParent = this.shouldNormalizeParent.bind(this);
|
|
|
let count = 0;
|
|
let count = 0;
|
|
|
const writeStream = new Writable({
|
|
const writeStream = new Writable({
|
|
|
objectMode: true,
|
|
objectMode: true,
|
|
@@ -1399,7 +1400,7 @@ class PageService {
|
|
|
async final(callback) {
|
|
async final(callback) {
|
|
|
const Page = mongoose.model('Page') as unknown as PageModel;
|
|
const Page = mongoose.model('Page') as unknown as PageModel;
|
|
|
// normalize parent of descendant pages
|
|
// normalize parent of descendant pages
|
|
|
- const shouldNormalize = targetPage.grant !== Page.GRANT_RESTRICTED && targetPage.grant !== Page.GRANT_SPECIFIED;
|
|
|
|
|
|
|
+ const shouldNormalize = shouldNormalizeParent(targetPage);
|
|
|
if (shouldNormalize) {
|
|
if (shouldNormalize) {
|
|
|
try {
|
|
try {
|
|
|
const newPath = Page.getRevertDeletedPageName(targetPage.path);
|
|
const newPath = Page.getRevertDeletedPageName(targetPage.path);
|