Skip to content

Node.js based forum software built for the modern web

updated upgrade script so that it does not rely on Groups.list, as the method has changed between v0.5.0 and v0.6.0.

Julian Lam88aa4276695b
diff --git a/src/upgrade.js b/src/upgrade.js
index 977854ab01..117b79848e 100644
--- a/src/upgrade.js
+++ b/src/upgrade.js
@@ -250,11 +250,24 @@ Upgrade.upgrade = function(callback) {
}, next);
}
- Groups.list({showSystemGroups: true}, function(err, groups) {
+ async.waterfall([
+ async.apply(db.getSetMembers, 'groups'),
+ function(groups, next) {
+ async.filter(groups, function(group, next) {
+ db.getObjectField('group:' + group, 'hidden', function(err, hidden) {
+ next(!parseInt(hidden, 10));
+ }, next);
+ }, function(groups) {
+ next(null, groups);
+ });
+ }
+ ], function(err, groups) {
if (err) {
return next(err);
}
+ groups.push('administrators', 'registered-users');
+
async.eachLimit(cids, 50, function(cid, next) {
upgradePrivileges(cid, groups, next);
}, next);
@@ -445,7 +458,7 @@ Upgrade.upgrade = function(callback) {
if (setting.dailyDigestFreq !== 'off') {
db.sortedSetAdd('digest:' + setting.dailyDigestFreq + ':uids', now, setting.uid, next);
} else {
- next(false);
+ setImmediate(next);
}
}, function(err) {
if (err) {