fix upgrade script to include main post, and fix post indices

This commit is contained in:
barisusakli
2014-10-22 19:33:47 -04:00
parent 9a21e9646f
commit 802c8b15e2
2 changed files with 9 additions and 9 deletions

View File

@@ -357,7 +357,7 @@ var async = require('async'),
return next(err);
}
topics = topics.map(function(topic) {
return topic && topic.postcount;
return topic && (parseInt(topic.postcount, 10) || 0);
});
next(null, topics);
@@ -409,7 +409,7 @@ var async = require('async'),
var teasers = tids.map(function(tid, index) {
if (tidToPost[tid]) {
tidToPost[tid].index = results.counts[index] + 1;
tidToPost[tid].index = results.counts[index];
}
return tidToPost[tid];
});