mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
pass the data used to create the category to filter:category.create
This commit is contained in:
@@ -38,7 +38,7 @@ module.exports = function(Categories) {
|
|||||||
imageClass: 'auto'
|
imageClass: 'auto'
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins.fireHook('filter:category.create', {category: category}, next);
|
plugins.fireHook('filter:category.create', {category: category, data: data}, next);
|
||||||
},
|
},
|
||||||
function(data, next) {
|
function(data, next) {
|
||||||
category = data.category;
|
category = data.category;
|
||||||
|
|||||||
@@ -18,11 +18,15 @@ module.exports = function(Categories) {
|
|||||||
|
|
||||||
var modifiedFields = modified[cid];
|
var modifiedFields = modified[cid];
|
||||||
|
|
||||||
if(modifiedFields.hasOwnProperty('name')){
|
if (modifiedFields.hasOwnProperty('name')) {
|
||||||
modifiedFields.slug = cid + '/' + utils.slugify(modifiedFields.name);
|
modifiedFields.slug = cid + '/' + utils.slugify(modifiedFields.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.fireHook('filter:category.update', {category:modifiedFields}, function(err, categoryData) {
|
plugins.fireHook('filter:category.update', {category: modifiedFields}, function(err, categoryData) {
|
||||||
|
if (err) {
|
||||||
|
return next(err);
|
||||||
|
}
|
||||||
|
|
||||||
var category = categoryData.category;
|
var category = categoryData.category;
|
||||||
var fields = Object.keys(category);
|
var fields = Object.keys(category);
|
||||||
async.each(fields, function(key, next) {
|
async.each(fields, function(key, next) {
|
||||||
|
|||||||
Reference in New Issue
Block a user