mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
fixing categories with null parentCids, again
This commit is contained in:
@@ -252,12 +252,14 @@ var async = require('async'),
|
||||
Categories.getMultipleCategoryFields(cids, ['parentCid'], function(err, data) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
} else if (!data.hasOwnProperty('parentCid')) {
|
||||
data.parentCid = 0;
|
||||
}
|
||||
|
||||
var parentCids = data.map(function(category) {
|
||||
return category && category.parentCid;
|
||||
if (category && category.hasOwnProperty('parentCid') && category.parentCid) {
|
||||
return category.parentCid;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
Categories.getCategoriesData(parentCids, callback);
|
||||
|
||||
Reference in New Issue
Block a user