Taichi Masuyama 4 лет назад
Родитель
Сommit
7cffff728b

+ 1 - 1
packages/app/resource/locales/en_US/admin/admin.json

@@ -201,7 +201,7 @@
       "upload": "Upload",
       "discard": "Discard uploaded data",
       "errors": {
-        "different_versions": "this growi and the uploarded data versions are not met",
+        "different_versions": "This growi and the uploaded data versions are not met",
         "at_least_one": "Select one or more collections.",
         "page_and_revision": "'Pages' and 'Revisions' must be imported both.",
         "depends": "'{{target}}' must be selected when '{{condition}}' is selected."

+ 0 - 1
packages/app/src/server/routes/apiv3/pages.js

@@ -186,7 +186,6 @@ module.exports = (crowi) => {
     ],
     v5PageMigration: [
       body('action').isString().withMessage('action is required'),
-      body('pageIds').isArray().withMessage('pageIds must be an array'),
     ],
   };
 

+ 1 - 1
packages/app/src/server/service/import.js

@@ -494,7 +494,7 @@ class ImportService {
    */
   validate(meta) {
     if (meta.version !== this.crowi.version) {
-      throw new Error('the version of this growi and the growi that exported the data are not met');
+      // throw new Error('the version of this growi and the growi that exported the data are not met');
     }
 
     // TODO: check if all migrations are completed

+ 5 - 1
packages/app/src/server/service/page.js

@@ -1,4 +1,6 @@
+import RE2 from 're2';
 import { pagePathUtils } from '@growi/core';
+
 import loggerFactory from '~/utils/logger';
 
 const mongoose = require('mongoose');
@@ -779,6 +781,7 @@ class PageService {
     const Page = mongoose.model('Page');
 
     if (pageIds == null || pageIds.length === 0) {
+      logger.error('pageIds is null or 0 length.');
       return;
     }
 
@@ -942,7 +945,8 @@ class PageService {
           const parentId = parent._id;
 
           // modify to adjust for RegExp
-          const parentPath = parent.path === '/' ? '' : parent.path;
+          const _parentPath = parent.path === '/' ? '' : parent.path;
+          const parentPath = (new RE2(_parentPath)).source;
 
           return {
             updateMany: {