From feed33f6e21210a1454494a5eeb064dd3a113f2b Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 10 Oct 2014 22:53:01 -0400 Subject: [PATCH] closes #2100 --- src/categories.js | 6 +++--- src/database/mongo/hash.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/categories.js b/src/categories.js index f6599d64ad..24b041eeb1 100644 --- a/src/categories.js +++ b/src/categories.js @@ -435,10 +435,10 @@ var db = require('./database'), db.incrObjectField('category:' + cid, 'post_count', next); }, function(next) { - if(parseInt(topicData.pinned, 10) === 0) { - db.sortedSetAdd('categories:' + cid + ':tid', postData.timestamp, postData.tid, next); - } else { + if (parseInt(topicData.pinned, 10) === 1) { next(); + } else { + db.sortedSetAdd('categories:' + cid + ':tid', postData.timestamp, postData.tid, next); } } ], callback); diff --git a/src/database/mongo/hash.js b/src/database/mongo/hash.js index 8471bd9c0a..43460f421c 100644 --- a/src/database/mongo/hash.js +++ b/src/database/mongo/hash.js @@ -87,7 +87,7 @@ module.exports = function(db, module) { item = item || {}; var result = {}; for(i=0; i