Skip to content

Node.js based forum software built for the modern web

fire action:topic.move after topic cid is changed

barisusakli2b7744f90501
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
+ });
});
});
};