diff --git a/public/src/client/topic/fork.js b/public/src/client/topic/fork.js index 92e9438b24..21f8d06e59 100644 --- a/public/src/client/topic/fork.js +++ b/public/src/client/topic/fork.js @@ -101,8 +101,8 @@ define('forum/topic/fork', function() { post.css('opacity', '1.0'); } - if(pids.length) { - pids.sort(); + if (pids.length) { + pids.sort(function(a,b) { return a - b; }); forkModal.find('#fork-pids').html(pids.toString()); } else { showNoPostsSelected(); diff --git a/src/topics/fork.js b/src/topics/fork.js index d5670bfb9a..4eb1274b2a 100644 --- a/src/topics/fork.js +++ b/src/topics/fork.js @@ -28,7 +28,9 @@ module.exports = function(Topics) { return callback(new Error('[[error:invalid-pid]]')); } - pids.sort(); + pids.sort(function(a, b) { + return a - b; + }); var mainPid = pids[0]; async.parallel({