mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
disable related topics if its set to 0
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user