mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 19:11:22 +01:00
removing disabled categories from being listed as children, #2080
This commit is contained in:
@@ -402,9 +402,10 @@ var db = require('./database'),
|
||||
Categories.getCategoriesData(cids, next);
|
||||
},
|
||||
function (categories, next) {
|
||||
// Filter categories to isolate children, and remove disabled categories
|
||||
async.map(cids, function(cid, next) {
|
||||
next(null, categories.filter(function(category) {
|
||||
return parseInt(category.parentCid, 10) === parseInt(cid, 10);
|
||||
return parseInt(category.parentCid, 10) === parseInt(cid, 10) && !category.disabled;
|
||||
}));
|
||||
}, next);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ module.exports = function(Categories) {
|
||||
function updateCategory(cid, next) {
|
||||
var category = modified[cid];
|
||||
var fields = Object.keys(category);
|
||||
console.log('updating', cid, 'fields:', fields);
|
||||
|
||||
async.each(fields, function(key, next) {
|
||||
updateCategoryField(cid, key, category[key], next);
|
||||
|
||||
Reference in New Issue
Block a user