From 2b7744f9050151db0160483ee52983ce3da15a77 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sun, 15 Mar 2015 00:24:08 -0400 Subject: [PATCH] fire action:topic.move after topic cid is changed --- src/threadTools.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/threadTools.js b/src/threadTools.js index 96d8198291..109a4215ce 100644 --- a/src/threadTools.js +++ b/src/threadTools.js @@ -183,13 +183,16 @@ var async = require('async'), categories.moveRecentReplies(tid, oldCid, cid); - topics.setTopicField(tid, 'cid', cid, callback); - - plugins.fireHook('action:topic.move', { - tid: tid, - fromCid: oldCid, - toCid: cid, - uid: uid + topics.setTopicField(tid, 'cid', cid, function(err) { + if (err) { + return callback(err); + } + plugins.fireHook('action:topic.move', { + tid: tid, + fromCid: oldCid, + toCid: cid, + uid: uid + }); }); }); };