2
0
Taichi Masuyama 4 жил өмнө
parent
commit
b8d7487595

+ 5 - 8
packages/app/src/server/models/obsolete-page.js

@@ -929,14 +929,9 @@ export const getPageSchema = (crowi) => {
       grant = GRANT_PUBLIC;
     }
 
-    const isV5Compatible = crowi.configManager.getConfig('crowi', 'app:isV5Compatible');
-    // for v4 compatibility
-    if (!isV5Compatible) {
-      const isExist = await this.count({ path });
-
-      if (isExist) {
-        throw new Error('Cannot create new page to existed path');
-      }
+    const isExist = await this.count({ path });
+    if (isExist) {
+      throw new Error('Cannot create new page to existed path');
     }
 
     /*
@@ -952,6 +947,8 @@ export const getPageSchema = (crowi) => {
       page = new Page();
     }
 
+    const isV5Compatible = crowi.configManager.getConfig('crowi', 'app:isV5Compatible');
+
     let parent = parentId;
     if (isV5Compatible && parent == null && !isTopPage(path)) {
       parent = await Page.getParentIdAndFillAncestors(path);