removing disabled categories from being listed as children, #2080

v1.18.x
Julian Lam 10 years ago
parent 51cefb00d2
commit d22fe4ad1e

@ -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);

Loading…
Cancel
Save