fix topic move, fix moveAll

move topic wasnt moving mainPid, also fixed crash on move all
clicking permissions on admin/categories no longer goes to top of page
This commit is contained in:
barisusakli
2014-06-24 17:40:41 -04:00
parent c3e4d11f69
commit eb9b4a62dc
3 changed files with 14 additions and 5 deletions

View File

@@ -36,15 +36,24 @@ module.exports = function(Categories) {
}
updatePostCount(tid, oldCid, cid);
topics.getPids(tid, function(err, pids) {
async.parallel({
mainPid: function(next) {
topics.getTopicField(tid, 'mainPid', next);
},
pids: function(next) {
topics.getPids(tid, next);
}
}, function(err, results) {
if (err) {
return winston.error(err.message);
}
if (pids && !pids.length) {
if (!results.mainPid && results.pids && !pids.length) {
return;
}
var pids = [results.mainPid].concat(results.pids);
var keys = pids.map(function(pid) {
return 'post:' + pid;
});