|
@@ -1,34 +1,37 @@
|
|
|
|
|
+import pathlib from 'path';
|
|
|
|
|
+import { Readable, Writable } from 'stream';
|
|
|
|
|
+
|
|
|
import { pagePathUtils, pathUtils } from '@growi/core';
|
|
import { pagePathUtils, pathUtils } from '@growi/core';
|
|
|
-import mongoose, { ObjectId, QueryCursor } from 'mongoose';
|
|
|
|
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
|
|
|
+import mongoose, { ObjectId, QueryCursor } from 'mongoose';
|
|
|
import streamToPromise from 'stream-to-promise';
|
|
import streamToPromise from 'stream-to-promise';
|
|
|
-import pathlib from 'path';
|
|
|
|
|
-import { Readable, Writable } from 'stream';
|
|
|
|
|
|
|
|
|
|
-import { createBatchStream } from '~/server/util/batch-stream';
|
|
|
|
|
-import loggerFactory from '~/utils/logger';
|
|
|
|
|
-import {
|
|
|
|
|
- CreateMethod, PageCreateOptions, PageModel, PageDocument,
|
|
|
|
|
-} from '~/server/models/page';
|
|
|
|
|
-import { stringifySnapshot } from '~/models/serializers/in-app-notification-snapshot/page';
|
|
|
|
|
|
|
+import { SUPPORTED_TARGET_MODEL_TYPE, SUPPORTED_ACTION_TYPE } from '~/interfaces/activity';
|
|
|
|
|
+import { Ref } from '~/interfaces/common';
|
|
|
|
|
+import { HasObjectId } from '~/interfaces/has-object-id';
|
|
|
import {
|
|
import {
|
|
|
IPage, IPageInfo, IPageInfoForEntity, IPageWithMeta,
|
|
IPage, IPageInfo, IPageInfoForEntity, IPageWithMeta,
|
|
|
} from '~/interfaces/page';
|
|
} from '~/interfaces/page';
|
|
|
-import { serializePageSecurely } from '../models/serializers/page-serializer';
|
|
|
|
|
-import { PageRedirectModel } from '../models/page-redirect';
|
|
|
|
|
-import Subscription from '../models/subscription';
|
|
|
|
|
-import { ObjectIdLike } from '../interfaces/mongoose-utils';
|
|
|
|
|
-import { IUserHasId } from '~/interfaces/user';
|
|
|
|
|
-import { Ref } from '~/interfaces/common';
|
|
|
|
|
-import { HasObjectId } from '~/interfaces/has-object-id';
|
|
|
|
|
-import { SocketEventName, UpdateDescCountRawData } from '~/interfaces/websocket';
|
|
|
|
|
import {
|
|
import {
|
|
|
PageDeleteConfigValue, IPageDeleteConfigValueToProcessValidation,
|
|
PageDeleteConfigValue, IPageDeleteConfigValueToProcessValidation,
|
|
|
} from '~/interfaces/page-delete-config';
|
|
} from '~/interfaces/page-delete-config';
|
|
|
-import PageOperation, { PageActionStage, PageActionType } from '../models/page-operation';
|
|
|
|
|
-import ActivityDefine from '../util/activityDefine';
|
|
|
|
|
|
|
+import { IUserHasId } from '~/interfaces/user';
|
|
|
|
|
+import { SocketEventName, UpdateDescCountRawData } from '~/interfaces/websocket';
|
|
|
|
|
+import { stringifySnapshot } from '~/models/serializers/in-app-notification-snapshot/page';
|
|
|
|
|
+import {
|
|
|
|
|
+ CreateMethod, PageCreateOptions, PageModel, PageDocument,
|
|
|
|
|
+} from '~/server/models/page';
|
|
|
|
|
+import { createBatchStream } from '~/server/util/batch-stream';
|
|
|
|
|
+import loggerFactory from '~/utils/logger';
|
|
|
import { prepareDeleteConfigValuesForCalc } from '~/utils/page-delete-config';
|
|
import { prepareDeleteConfigValuesForCalc } from '~/utils/page-delete-config';
|
|
|
|
|
|
|
|
|
|
+import { ObjectIdLike } from '../interfaces/mongoose-utils';
|
|
|
|
|
+import { PathAlreadyExistsError } from '../models/errors';
|
|
|
|
|
+import PageOperation, { PageActionStage, PageActionType } from '../models/page-operation';
|
|
|
|
|
+import { PageRedirectModel } from '../models/page-redirect';
|
|
|
|
|
+import { serializePageSecurely } from '../models/serializers/page-serializer';
|
|
|
|
|
+import Subscription from '../models/subscription';
|
|
|
|
|
+
|
|
|
const debug = require('debug')('growi:services:page');
|
|
const debug = require('debug')('growi:services:page');
|
|
|
|
|
|
|
|
const logger = loggerFactory('growi:services:page');
|
|
const logger = loggerFactory('growi:services:page');
|
|
@@ -154,7 +157,7 @@ class PageService {
|
|
|
this.pageEvent.onUpdate();
|
|
this.pageEvent.onUpdate();
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await this.createAndSendNotifications(page, user, ActivityDefine.ACTION_PAGE_UPDATE);
|
|
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_UPDATE);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
logger.error(err);
|
|
logger.error(err);
|
|
@@ -164,7 +167,17 @@ class PageService {
|
|
|
// rename
|
|
// rename
|
|
|
this.pageEvent.on('rename', async(page, user) => {
|
|
this.pageEvent.on('rename', async(page, user) => {
|
|
|
try {
|
|
try {
|
|
|
- await this.createAndSendNotifications(page, user, ActivityDefine.ACTION_PAGE_RENAME);
|
|
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_RENAME);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ logger.error(err);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // duplicate
|
|
|
|
|
+ this.pageEvent.on('duplicate', async(page, user) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_DUPLICATE);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
logger.error(err);
|
|
logger.error(err);
|
|
@@ -174,7 +187,7 @@ class PageService {
|
|
|
// delete
|
|
// delete
|
|
|
this.pageEvent.on('delete', async(page, user) => {
|
|
this.pageEvent.on('delete', async(page, user) => {
|
|
|
try {
|
|
try {
|
|
|
- await this.createAndSendNotifications(page, user, ActivityDefine.ACTION_PAGE_DELETE);
|
|
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_DELETE);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
logger.error(err);
|
|
logger.error(err);
|
|
@@ -184,7 +197,17 @@ class PageService {
|
|
|
// delete completely
|
|
// delete completely
|
|
|
this.pageEvent.on('deleteCompletely', async(page, user) => {
|
|
this.pageEvent.on('deleteCompletely', async(page, user) => {
|
|
|
try {
|
|
try {
|
|
|
- await this.createAndSendNotifications(page, user, ActivityDefine.ACTION_PAGE_DELETE_COMPLETELY);
|
|
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_DELETE_COMPLETELY);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ logger.error(err);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // revert
|
|
|
|
|
+ this.pageEvent.on('revert', async(page, user) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_REVERT);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
logger.error(err);
|
|
logger.error(err);
|
|
@@ -194,7 +217,7 @@ class PageService {
|
|
|
// likes
|
|
// likes
|
|
|
this.pageEvent.on('like', async(page, user) => {
|
|
this.pageEvent.on('like', async(page, user) => {
|
|
|
try {
|
|
try {
|
|
|
- await this.createAndSendNotifications(page, user, ActivityDefine.ACTION_PAGE_LIKE);
|
|
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_LIKE);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
logger.error(err);
|
|
logger.error(err);
|
|
@@ -204,7 +227,7 @@ class PageService {
|
|
|
// bookmark
|
|
// bookmark
|
|
|
this.pageEvent.on('bookmark', async(page, user) => {
|
|
this.pageEvent.on('bookmark', async(page, user) => {
|
|
|
try {
|
|
try {
|
|
|
- await this.createAndSendNotifications(page, user, ActivityDefine.ACTION_PAGE_BOOKMARK);
|
|
|
|
|
|
|
+ await this.createAndSendNotifications(page, user, SUPPORTED_ACTION_TYPE.ACTION_PAGE_BOOKMARK);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
logger.error(err);
|
|
logger.error(err);
|
|
@@ -963,6 +986,7 @@ class PageService {
|
|
|
newPagePath, page.revision.body, user, options,
|
|
newPagePath, page.revision.body, user, options,
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
+ this.pageEvent.emit('duplicate', page, user);
|
|
|
|
|
|
|
|
// 4. Take over tags
|
|
// 4. Take over tags
|
|
|
const originTags = await page.findRelatedTagsById();
|
|
const originTags = await page.findRelatedTagsById();
|
|
@@ -1057,6 +1081,7 @@ class PageService {
|
|
|
const createdPage = await Page.create(
|
|
const createdPage = await Page.create(
|
|
|
newPagePath, page.revision.body, user, options,
|
|
newPagePath, page.revision.body, user, options,
|
|
|
);
|
|
);
|
|
|
|
|
+ this.pageEvent.emit('duplicate', page, user);
|
|
|
|
|
|
|
|
if (isRecursively) {
|
|
if (isRecursively) {
|
|
|
this.duplicateDescendantsWithStream(page, newPagePath, user);
|
|
this.duplicateDescendantsWithStream(page, newPagePath, user);
|
|
@@ -1879,7 +1904,7 @@ class PageService {
|
|
|
|
|
|
|
|
// throw if any page already exists
|
|
// throw if any page already exists
|
|
|
if (originPage != null) {
|
|
if (originPage != null) {
|
|
|
- throw Error(`This page cannot be reverted since a page with path "${originPage.path}" already exists. Rename the existing pages first.`);
|
|
|
|
|
|
|
+ throw new PathAlreadyExistsError('already_exists', originPage.path);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 2. Revert target
|
|
// 2. Revert target
|
|
@@ -1891,6 +1916,8 @@ class PageService {
|
|
|
}, { new: true });
|
|
}, { new: true });
|
|
|
await PageTagRelation.updateMany({ relatedPage: page._id }, { $set: { isPageTrashed: false } });
|
|
await PageTagRelation.updateMany({ relatedPage: page._id }, { $set: { isPageTrashed: false } });
|
|
|
|
|
|
|
|
|
|
+ this.pageEvent.emit('revert', page, user);
|
|
|
|
|
+
|
|
|
if (!isRecursively) {
|
|
if (!isRecursively) {
|
|
|
await this.updateDescendantCountOfAncestors(parent._id, 1, true);
|
|
await this.updateDescendantCountOfAncestors(parent._id, 1, true);
|
|
|
}
|
|
}
|
|
@@ -1973,7 +2000,7 @@ class PageService {
|
|
|
const newPath = Page.getRevertDeletedPageName(page.path);
|
|
const newPath = Page.getRevertDeletedPageName(page.path);
|
|
|
const originPage = await Page.findByPath(newPath);
|
|
const originPage = await Page.findByPath(newPath);
|
|
|
if (originPage != null) {
|
|
if (originPage != null) {
|
|
|
- throw Error(`This page cannot be reverted since a page with path "${originPage.path}" already exists.`);
|
|
|
|
|
|
|
+ throw new PathAlreadyExistsError('already_exists', originPage.path);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (isRecursively) {
|
|
if (isRecursively) {
|
|
@@ -1990,6 +2017,8 @@ class PageService {
|
|
|
}, { new: true });
|
|
}, { new: true });
|
|
|
await PageTagRelation.updateMany({ relatedPage: page._id }, { $set: { isPageTrashed: false } });
|
|
await PageTagRelation.updateMany({ relatedPage: page._id }, { $set: { isPageTrashed: false } });
|
|
|
|
|
|
|
|
|
|
+ this.pageEvent.emit('revert', page, user);
|
|
|
|
|
+
|
|
|
return updatedPage;
|
|
return updatedPage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2208,7 +2237,7 @@ class PageService {
|
|
|
// Create activity
|
|
// Create activity
|
|
|
const parameters = {
|
|
const parameters = {
|
|
|
user: user._id,
|
|
user: user._id,
|
|
|
- targetModel: ActivityDefine.MODEL_PAGE,
|
|
|
|
|
|
|
+ targetModel: SUPPORTED_TARGET_MODEL_TYPE.MODEL_PAGE,
|
|
|
target: page,
|
|
target: page,
|
|
|
action,
|
|
action,
|
|
|
};
|
|
};
|
|
@@ -2294,23 +2323,25 @@ class PageService {
|
|
|
throw Error('Restricted pages can not be migrated');
|
|
throw Error('Restricted pages can not be migrated');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let updatedPage;
|
|
|
|
|
|
|
+ let normalizedPage;
|
|
|
|
|
|
|
|
// replace if empty page exists
|
|
// replace if empty page exists
|
|
|
if (existingPage != null && existingPage.isEmpty) {
|
|
if (existingPage != null && existingPage.isEmpty) {
|
|
|
- await Page.replaceTargetWithPage(existingPage, page, true);
|
|
|
|
|
- updatedPage = await Page.findById(page._id);
|
|
|
|
|
|
|
+ // Inherit descendantCount from the empty page
|
|
|
|
|
+ const updatedPage = await Page.findOneAndUpdate({ _id: page._id }, { descendantCount: existingPage.descendantCount }, { new: true });
|
|
|
|
|
+ await Page.replaceTargetWithPage(existingPage, updatedPage, true);
|
|
|
|
|
+ normalizedPage = await Page.findById(page._id);
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
const parent = await Page.getParentAndFillAncestors(page.path, user);
|
|
const parent = await Page.getParentAndFillAncestors(page.path, user);
|
|
|
- updatedPage = await Page.findOneAndUpdate({ _id: page._id }, { parent: parent._id }, { new: true });
|
|
|
|
|
|
|
+ normalizedPage = await Page.findOneAndUpdate({ _id: page._id }, { parent: parent._id }, { new: true });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Update descendantCount
|
|
// Update descendantCount
|
|
|
const inc = 1;
|
|
const inc = 1;
|
|
|
- await this.updateDescendantCountOfAncestors(updatedPage.parent, inc, true);
|
|
|
|
|
|
|
+ await this.updateDescendantCountOfAncestors(normalizedPage.parent, inc, true);
|
|
|
|
|
|
|
|
- return updatedPage;
|
|
|
|
|
|
|
+ return normalizedPage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async normalizeParentRecursivelyByPages(pages, user): Promise<void> {
|
|
async normalizeParentRecursivelyByPages(pages, user): Promise<void> {
|
|
@@ -2356,6 +2387,17 @@ class PageService {
|
|
|
throw Error(`Cannot operate normalizeParentRecursiively to path "${page.path}" right now.`);
|
|
throw Error(`Cannot operate normalizeParentRecursiively to path "${page.path}" right now.`);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const Page = mongoose.model('Page') as unknown as PageModel;
|
|
|
|
|
+ const { PageQueryBuilder } = Page;
|
|
|
|
|
+ const builder = new PageQueryBuilder(Page.findOne());
|
|
|
|
|
+ builder.addConditionAsMigrated();
|
|
|
|
|
+ builder.addConditionToListByPathsArray([page.path]);
|
|
|
|
|
+ const existingPage = await builder.query.exec();
|
|
|
|
|
+
|
|
|
|
|
+ if (existingPage?.parent != null) {
|
|
|
|
|
+ throw Error('This page has already converted.');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let pageOp;
|
|
let pageOp;
|
|
|
try {
|
|
try {
|
|
|
pageOp = await PageOperation.create({
|
|
pageOp = await PageOperation.create({
|
|
@@ -2371,7 +2413,14 @@ class PageService {
|
|
|
logger.error('Failed to create PageOperation document.', err);
|
|
logger.error('Failed to create PageOperation document.', err);
|
|
|
throw err;
|
|
throw err;
|
|
|
}
|
|
}
|
|
|
- await this.normalizeParentRecursivelyMainOperation(page, user, pageOp._id);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ await this.normalizeParentRecursivelyMainOperation(page, user, pageOp._id);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ logger.err('Failed to run normalizeParentRecursivelyMainOperation.', err);
|
|
|
|
|
+ throw err;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2381,6 +2430,7 @@ class PageService {
|
|
|
const { PageQueryBuilder } = Page;
|
|
const { PageQueryBuilder } = Page;
|
|
|
const builder = new PageQueryBuilder(Page.findOne(), true);
|
|
const builder = new PageQueryBuilder(Page.findOne(), true);
|
|
|
builder.addConditionAsMigrated();
|
|
builder.addConditionAsMigrated();
|
|
|
|
|
+ builder.addConditionToListByPathsArray([page.path]);
|
|
|
const exPage = await builder.query.exec();
|
|
const exPage = await builder.query.exec();
|
|
|
const options = { prevDescendantCount: exPage?.descendantCount ?? 0 };
|
|
const options = { prevDescendantCount: exPage?.descendantCount ?? 0 };
|
|
|
|
|
|
|
@@ -2557,18 +2607,9 @@ class PageService {
|
|
|
return this._normalizeParentRecursively(pathAndRegExpsToNormalize, ancestorPaths, grantFiltersByUser, user);
|
|
return this._normalizeParentRecursively(pathAndRegExpsToNormalize, ancestorPaths, grantFiltersByUser, user);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private async _normalizeParentRecursively(
|
|
|
|
|
- pathOrRegExps: (RegExp | string)[], publicPathsToNormalize: string[], grantFiltersByUser: { $or: any[] }, user, count = 0, skiped = 0, isFirst = true,
|
|
|
|
|
- ): Promise<void> {
|
|
|
|
|
- const BATCH_SIZE = 100;
|
|
|
|
|
- const PAGES_LIMIT = 1000;
|
|
|
|
|
-
|
|
|
|
|
- const socket = this.crowi.socketIoService.getAdminSocket();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ private buildFilterForNormalizeParentRecursively(pathOrRegExps: (RegExp | string)[], publicPathsToNormalize: string[], grantFiltersByUser: { $or: any[] }) {
|
|
|
const Page = mongoose.model('Page') as unknown as PageModel;
|
|
const Page = mongoose.model('Page') as unknown as PageModel;
|
|
|
- const { PageQueryBuilder } = Page;
|
|
|
|
|
|
|
|
|
|
- // Build filter
|
|
|
|
|
const andFilter: any = {
|
|
const andFilter: any = {
|
|
|
$and: [
|
|
$and: [
|
|
|
{
|
|
{
|
|
@@ -2605,9 +2646,26 @@ class PageService {
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ return mergedFilter;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private async _normalizeParentRecursively(
|
|
|
|
|
+ pathOrRegExps: (RegExp | string)[], publicPathsToNormalize: string[], grantFiltersByUser: { $or: any[] }, user, count = 0, skiped = 0, isFirst = true,
|
|
|
|
|
+ ): Promise<void> {
|
|
|
|
|
+ const BATCH_SIZE = 100;
|
|
|
|
|
+ const PAGES_LIMIT = 1000;
|
|
|
|
|
+
|
|
|
|
|
+ const socket = this.crowi.socketIoService.getAdminSocket();
|
|
|
|
|
+
|
|
|
|
|
+ const Page = mongoose.model('Page') as unknown as PageModel;
|
|
|
|
|
+ const { PageQueryBuilder } = Page;
|
|
|
|
|
+
|
|
|
|
|
+ // Build filter
|
|
|
|
|
+ const matchFilter = this.buildFilterForNormalizeParentRecursively(pathOrRegExps, publicPathsToNormalize, grantFiltersByUser);
|
|
|
|
|
+
|
|
|
let baseAggregation = Page
|
|
let baseAggregation = Page
|
|
|
.aggregate([
|
|
.aggregate([
|
|
|
- { $match: mergedFilter },
|
|
|
|
|
|
|
+ { $match: matchFilter },
|
|
|
{
|
|
{
|
|
|
$project: { // minimize data to fetch
|
|
$project: { // minimize data to fetch
|
|
|
_id: 1,
|
|
_id: 1,
|
|
@@ -2617,7 +2675,7 @@ class PageService {
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
// Limit pages to get
|
|
// Limit pages to get
|
|
|
- const total = await Page.countDocuments(mergedFilter);
|
|
|
|
|
|
|
+ const total = await Page.countDocuments(matchFilter);
|
|
|
if (isFirst) {
|
|
if (isFirst) {
|
|
|
socket.emit(SocketEventName.PMStarted, { total });
|
|
socket.emit(SocketEventName.PMStarted, { total });
|
|
|
}
|
|
}
|
|
@@ -2698,6 +2756,9 @@ class PageService {
|
|
|
{
|
|
{
|
|
|
path: { $regex: new RegExp(`^${parentPathEscaped}(\\/[^/]+)\\/?$`, 'i') }, // see: regexr.com/6889f (e.g. /parent/any_child or /any_level1)
|
|
path: { $regex: new RegExp(`^${parentPathEscaped}(\\/[^/]+)\\/?$`, 'i') }, // see: regexr.com/6889f (e.g. /parent/any_child or /any_level1)
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ path: { $in: pathOrRegExps.concat(publicPathsToNormalize) },
|
|
|
|
|
+ },
|
|
|
filterForApplicableAncestors,
|
|
filterForApplicableAncestors,
|
|
|
grantFiltersByUser,
|
|
grantFiltersByUser,
|
|
|
],
|
|
],
|
|
@@ -2754,7 +2815,7 @@ class PageService {
|
|
|
|
|
|
|
|
await streamToPromise(migratePagesStream);
|
|
await streamToPromise(migratePagesStream);
|
|
|
|
|
|
|
|
- if (await Page.exists(mergedFilter) && shouldContinue) {
|
|
|
|
|
|
|
+ if (await Page.exists(matchFilter) && shouldContinue) {
|
|
|
return this._normalizeParentRecursively(pathOrRegExps, publicPathsToNormalize, grantFiltersByUser, user, nextCount, nextSkiped, false);
|
|
return this._normalizeParentRecursively(pathOrRegExps, publicPathsToNormalize, grantFiltersByUser, user, nextCount, nextSkiped, false);
|
|
|
}
|
|
}
|
|
|
|
|
|