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
v1.18.x
barisusakli 11 years ago
parent c3e4d11f69
commit eb9b4a62dc

@ -192,10 +192,10 @@ define('forum/admin/categories', ['uploader', 'forum/admin/iconSelect'], functio
});
});
// Permissions modal
$('.admin-categories').on('click', '.permissions', function() {
var cid = $(this).parents('li[data-cid]').attr('data-cid');
Categories.launchPermissionsModal(cid);
return false;
});

@ -20,7 +20,7 @@ define('forum/topic/move', function() {
modal.on('shown.bs.modal', onMoveModalShown);
$('#move-confirm').hide();
if (tids.length > 1) {
if (Move.moveAll || (tids && tids.length > 1)) {
translator.translate('[[topic:move_topics]]', function(translated) {
modal.find('.modal-header h3').text(translated);
});

@ -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;
});

Loading…
Cancel
Save