Node.js based forum software built for the modern web
some fixes for search plugin
Baris Soner Usakli24b669bd396f
diff --git a/src/postTools.js b/src/postTools.jsindex a097df2d30..b610e19415 100644--- a/src/postTools.js+++ b/src/postTools.js@@ -90,9 +90,7 @@ var winston = require('winston'),topics.setTopicField(tid, 'thumb', options.topic_thumb);- db.searchRemove('topic', tid, function() {- db.searchIndex('topic', title, tid);- });+ plugins.fireHook('action:topic.edit', tid);}posts.getPostData(pid, function(err, postData) {diff --git a/src/posts.js b/src/posts.jsindex 18d71deb0f..ac428870d0 100644--- a/src/posts.js+++ b/src/posts.js@@ -92,10 +92,10 @@ var db = require('./database'),return next(err);}- postData.content = content;-plugins.fireHook('action:post.save', postData);+ postData.content = content;+next(null, postData);});}diff --git a/src/routes/api.js b/src/routes/api.jsindex 134964d185..3274b4c584 100644--- a/src/routes/api.js+++ b/src/routes/api.js@@ -393,15 +393,13 @@ var path = require('path'),return res.redirect('/404');}- var limit = 50;-function searchPosts(callback) {Plugins.fireHook('filter:search.query', {index: 'post',- query: req.params.terms+ query: req.params.term}, function(err, pids) {if (err) {- return callback(err, null);+ return callback(err);}posts.getPostSummaryByPids(pids, false, callback);@@ -411,10 +409,10 @@ var path = require('path'),function searchTopics(callback) {Plugins.fireHook('filter:search.query', {index: 'topic',- query: req.params.terms+ query: req.params.term}, function(err, tids) {if (err) {- return callback(err, null);+ return callback(err);}topics.getTopicsByTids(tids, 0, callback);