Explorar o código

Merge branch 'imprv/duplicate-descendants' into imprv/delete-single-page

Taichi Masuyama %!s(int64=4) %!d(string=hai) anos
pai
achega
261de74f90
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      packages/app/src/server/service/page.ts

+ 2 - 2
packages/app/src/server/service/page.ts

@@ -201,7 +201,7 @@ class PageService {
     const isV5Compatible = this.crowi.configManager.getConfig('crowi', 'app:isV5Compatible');
     const isV5Compatible = this.crowi.configManager.getConfig('crowi', 'app:isV5Compatible');
     const isRoot = isTopPage(page.path);
     const isRoot = isTopPage(page.path);
     const isPageRestricted = page.grant === Page.GRANT_RESTRICTED;
     const isPageRestricted = page.grant === Page.GRANT_RESTRICTED;
-    const shouldUseV4Process = !isV5Compatible || !isPageMigrated || !isRoot || isPageRestricted;
+    const shouldUseV4Process = !isRoot && !isPageRestricted && (!isV5Compatible || !isPageMigrated);
     if (shouldUseV4Process) {
     if (shouldUseV4Process) {
       return this.renamePageV4(page, newPagePath, user, options);
       return this.renamePageV4(page, newPagePath, user, options);
     }
     }
@@ -492,7 +492,7 @@ class PageService {
     const isV5Compatible = this.crowi.configManager.getConfig('crowi', 'app:isV5Compatible');
     const isV5Compatible = this.crowi.configManager.getConfig('crowi', 'app:isV5Compatible');
     const isRoot = isTopPage(page.path);
     const isRoot = isTopPage(page.path);
     const isPageRestricted = page.grant === Page.GRANT_RESTRICTED;
     const isPageRestricted = page.grant === Page.GRANT_RESTRICTED;
-    const shouldUseV4Process = !isV5Compatible || !isPageMigrated || !isRoot || isPageRestricted;
+    const shouldUseV4Process = !isRoot && !isPageRestricted && (!isV5Compatible || !isPageMigrated);
     if (shouldUseV4Process) {
     if (shouldUseV4Process) {
       return this.duplicateV4(page, newPagePath, user, isRecursively);
       return this.duplicateV4(page, newPagePath, user, isRecursively);
     }
     }