Merge remote-tracking branch 'origin/hashtalk' into hashtalk

This commit is contained in:
Julian Lam
2014-09-23 16:02:22 -04:00
3 changed files with 23 additions and 5 deletions

View File

@@ -144,8 +144,16 @@ var fs = require('fs'),
return callback(pluginPath.match('nodebb-theme') ? null : err);
}
var pluginData = JSON.parse(data),
libraryPath, staticDir;
try {
var pluginData = JSON.parse(data),
libraryPath, staticDir;
} catch (err) {
var pluginDir = pluginPath.split(path.sep);
pluginDir = pluginDir[pluginDir.length -1];
winston.error('[plugins/' + pluginDir + '] Plugin not loaded - please check its plugin.json for errors');
return callback();
}
/*
Starting v0.5.0, `minver` is deprecated in favour of `compatibility`.

View File

@@ -343,7 +343,11 @@ var async = require('async'),
next(null, post);
});
}, callback);
}, function(err, posts) {
plugins.fireHook('filter:post.getPostSummaryByPids', {posts: posts, uid: uid}, function(err, postData) {
callback(err, postData.posts);
});
});
});
});
};