Compare commits

...

4 Commits

Author SHA1 Message Date
renovate[bot]
ab5035f4e2 fix(deps): update dependency nodebb-plugin-dbsearch to v3.0.3 (#7035) 2018-11-30 12:54:13 -05:00
Baris Usakli
2555d72c84 change deprecated message 2018-11-30 12:53:21 -05:00
Barış Soner Uşaklı
213582df8b dont crash for undefined categories 2018-11-29 10:41:37 -05:00
Misty (Bot)
543336070a Incremented version number - v1.11.0 2018-11-28 21:53:14 +00:00
3 changed files with 10 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPL-3.0",
"description": "NodeBB Forum",
"version": "1.10.2",
"version": "1.11.0",
"homepage": "http://www.nodebb.org",
"repository": {
"type": "git",
@@ -80,7 +80,7 @@
"mubsub-nbb": "^1.5.0",
"nconf": "^0.10.0",
"nodebb-plugin-composer-default": "6.1.10",
"nodebb-plugin-dbsearch": "3.0.0",
"nodebb-plugin-dbsearch": "3.0.3",
"nodebb-plugin-emoji": "^2.2.5",
"nodebb-plugin-emoji-android": "2.0.0",
"nodebb-plugin-markdown": "8.8.5",
@@ -169,4 +169,4 @@
"url": "https://github.com/barisusakli"
}
]
}
}

View File

@@ -335,12 +335,14 @@ Categories.flattenCategories = function (allCategories, categoryData) {
*/
Categories.getTree = function (categories, parentCid) {
parentCid = parentCid || 0;
const cids = categories.map(category => category.cid);
const cids = categories.map(category => category && category.cid);
const cidToCategory = {};
const parents = {};
cids.forEach((cid, index) => {
cidToCategory[cid] = categories[index];
parents[cid] = _.clone(categories[index]);
if (cid) {
cidToCategory[cid] = categories[index];
parents[cid] = _.clone(categories[index]);
}
});
const tree = [];

View File

@@ -47,11 +47,11 @@ module.require = function (p) {
if (err.code === 'MODULE_NOT_FOUND') {
let stackLine = err.stack.split('\n');
stackLine = stackLine.find(line => line.includes('nodebb-plugin') || line.includes('nodebb-theme'));
winston.warn('[plugins/require] ' + err.message + ', please update your plugin!\n' + stackLine);
var deprecatedPath = err.message.replace('Cannot find module ', '');
winston.warn('[deprecated] requiring core modules with `module.parent.require(' + deprecatedPath + ')` is deprecated. Please use `require.main.require("./src/<module_name>")` instead.\n' + stackLine);
if (path.isAbsolute(p)) {
throw err;
}
return defaultRequire.apply(module, [path.join('../', p)]);
}
throw err;