disable related topics if its set to 0

v1.18.x
barisusakli 9 years ago
parent cb8fcb80d1
commit 41d10d18a1

@ -327,12 +327,13 @@ module.exports = function(Topics) {
return plugins.fireHook('filter:topic.getRelatedTopics', {topic: topicData, uid: uid}, callback);
}
var maximumTopics = parseInt(meta.config.maximumRelatedTopics, 10) || 5;
if (!topicData.tags.length || maximumTopics === 0) {
var maximumTopics = parseInt(meta.config.maximumRelatedTopics, 10);
if (maximumTopics === 0 || !topicData.tags.length) {
return callback(null, []);
}
maximumTopics = maximumTopics || 5;
async.waterfall([
function (next) {
async.map(topicData.tags, function (tag, next) {

Loading…
Cancel
Save