Bläddra i källkod

Merge pull request #93 from weseek/master

release v1.2.1
Yuki Takei 9 år sedan
förälder
incheckning
152d653f49
4 ändrade filer med 17 tillägg och 9 borttagningar
  1. 4 0
      CHANGES.md
  2. 1 0
      config/env.dev.js
  3. 11 8
      lib/util/middlewares.js
  4. 1 1
      package.json

+ 4 - 0
CHANGES.md

@@ -1,6 +1,10 @@
 CHANGES
 CHANGES
 ========
 ========
 
 
+## 1.2.1
+
+* Fix: buildIndex error occured when access to installer
+
 ## 1.2.0
 ## 1.2.0
 
 
 * Support: Merge official Crowi v1.6.2
 * Support: Merge official Crowi v1.6.2

+ 1 - 0
config/env.dev.js

@@ -1,5 +1,6 @@
 module.exports = {
 module.exports = {
   NODE_ENV: 'development',
   NODE_ENV: 'development',
+  // MATHJAX: 1,
   // REDIS_URL: 'redis://localhost:6379/crowi',
   // REDIS_URL: 'redis://localhost:6379/crowi',
   // ELASTICSEARCH_URI: 'http://localhost:9200/crowi',
   // ELASTICSEARCH_URI: 'http://localhost:9200/crowi',
   PLUGIN_NAMES_TOBE_LOADED: [
   PLUGIN_NAMES_TOBE_LOADED: [

+ 11 - 8
lib/util/middlewares.js

@@ -261,15 +261,18 @@ exports.applicationNotInstalled = function() {
 
 
 exports.checkSearchIndicesGenerated = function(crowi, app) {
 exports.checkSearchIndicesGenerated = function(crowi, app) {
   return function(req, res, next) {
   return function(req, res, next) {
-    // build index
     const searcher = crowi.getSearcher();
     const searcher = crowi.getSearcher();
-    searcher.buildIndex()
-      .then((data) => {
-        if (!data.errors) {
-          debug('Index created.');
-        }
-        return searcher.addAllPages();
-      });
+
+    // build index
+    if (searcher) {
+      searcher.buildIndex()
+        .then((data) => {
+          if (!data.errors) {
+            debug('Index created.');
+          }
+          return searcher.addAllPages();
+        });
+    }
 
 
     return next();
     return next();
   };
   };

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "crowi-plus",
   "name": "crowi-plus",
-  "version": "1.2.0-RC",
+  "version": "1.2.1-RC",
   "description": "Enhanced Crowi",
   "description": "Enhanced Crowi",
   "tags": [
   "tags": [
     "wiki",
     "wiki",