diff --git a/package.json b/package.json
index 37f7911604..4fd88722d7 100644
--- a/package.json
+++ b/package.json
@@ -53,7 +53,7 @@
"nodebb-plugin-spam-be-gone": "0.4.5",
"nodebb-rewards-essentials": "0.0.8",
"nodebb-theme-lavender": "3.0.9",
- "nodebb-theme-persona": "4.0.93",
+ "nodebb-theme-persona": "4.0.94",
"nodebb-theme-vanilla": "5.0.54",
"nodebb-widget-essentials": "2.0.8",
"nodemailer": "2.0.0",
diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js
index bdc4176d52..8d6b213a1d 100644
--- a/public/src/modules/helpers.js
+++ b/public/src/modules/helpers.js
@@ -113,7 +113,7 @@
'' +
'' + child.name + ' ';
});
- html = html ? ('
' + html + '') : html;
+ html = html ? ('' + html + '') : html;
return html;
};
diff --git a/src/categories/create.js b/src/categories/create.js
index fbd448407d..69d1f4dcd8 100644
--- a/src/categories/create.js
+++ b/src/categories/create.js
@@ -17,15 +17,15 @@ module.exports = function(Categories) {
db.incrObjectField('global', 'nextCid', next);
},
function(cid, next) {
- var slug = cid + '/' + utils.slugify(data.name),
- order = data.order || cid, // If no order provided, place it at the end
- colours = Categories.assignColours();
+ var slug = cid + '/' + utils.slugify(data.name);
+ var order = data.order || cid; // If no order provided, place it at the end
+ var colours = Categories.assignColours();
category = {
cid: cid,
name: data.name,
- description: ( data.description ? data.description : '' ),
- icon: ( data.icon ? data.icon : '' ),
+ description: data.description ? data.description : '',
+ icon: data.icon ? data.icon : '',
bgColor: data.bgColor || colours[0],
color: data.color || colours[1],
slug: slug,
@@ -49,6 +49,7 @@ module.exports = function(Categories) {
async.series([
async.apply(db.setObject, 'category:' + category.cid, category),
+ async.apply(Categories.parseDescription, category.cid, category.description),
async.apply(db.sortedSetAdd, 'categories:cid', category.order, category.cid),
async.apply(db.sortedSetAdd, 'cid:' + parentCid + ':children', category.order, category.cid),
async.apply(privileges.categories.give, defaultPrivileges, category.cid, 'administrators'),
diff --git a/src/categories/update.js b/src/categories/update.js
index ffd9bc5cec..78e97e4076 100644
--- a/src/categories/update.js
+++ b/src/categories/update.js
@@ -72,7 +72,7 @@ module.exports = function(Categories) {
if (key === 'order') {
updateOrder(cid, value, callback);
} else if (key === 'description') {
- parseDescription(cid, value, callback);
+ Categories.parseDescription(cid, value, callback);
} else {
callback();
}
@@ -100,7 +100,7 @@ module.exports = function(Categories) {
function (next) {
db.setObjectField('category:' + cid, 'parentCid', newParent, next);
}
- ], function(err, results) {
+ ], function(err) {
callback(err);
});
});
@@ -124,13 +124,13 @@ module.exports = function(Categories) {
});
}
- function parseDescription(cid, description, callback) {
+ Categories.parseDescription = function(cid, description, callback) {
plugins.fireHook('filter:parse.raw', description, function(err, parsedDescription) {
if (err) {
return callback(err);
}
Categories.setCategoryField(cid, 'descriptionParsed', parsedDescription, callback);
});
- }
+ };
};