rm cls because it's not ready yet

This commit is contained in:
akhoury
2016-06-24 16:57:58 -04:00
parent 3e8e2f0e58
commit 46a57f5d5c
6 changed files with 4 additions and 87 deletions

View File

@@ -7,29 +7,6 @@ module.exports = function(Plugins) {
Plugins.deprecatedHooks = {
'filter:user.custom_fields': null // remove in v1.1.0
};
Plugins.deprecatedHooksParams = {
'action:homepage.get': '{req, res}',
'filter:register.check': '{req, res}',
'action:user.loggedOut': '{req, res}',
'static:user.loggedOut': '{req, res}',
'filter:categories.build': '{req, res}',
'filter:category.build': '{req, res}',
'filter:group.build': '{req, res}',
'filter:register.build': '{req, res}',
'filter:composer.build': '{req, res}',
'filter:popular.build': '{req, res}',
'filter:recent.build': '{req, res}',
'filter:topic.build': '{req, res}',
'filter:users.build': '{req, res}',
'filter:admin.category.get': '{req, res}',
'filter:middleware.renderHeader': '{req, res}',
'filter:widget.render': '{req, res}',
'filter:middleware.buildHeader': '{req, locals}',
'action:middleware.pageView': '{req}',
'action:meta.override404': '{req}'
};
/*
`data` is an object consisting of (* is required):
`data.hook`*, the name of the NodeBB hook
@@ -62,12 +39,6 @@ module.exports = function(Plugins) {
parts.pop();
}
var hook = parts.join(':');
if (Plugins.deprecatedHooksParams[hook]) {
winston.warn('[plugins/' + id + '] Hook `' + hook + '` parameters: `' + Plugins.deprecatedHooksParams[hook] + '`, are being deprecated, '
+ 'all plugins should now use the `middleware/cls` module instead of hook\'s arguments to get a reference to the `http-request` or the `socket-request` object(s) (from which you can get the current `uid` if you need to.) '
+ '- for more info, visit https://docs.nodebb.org/en/latest/plugins/create.html#getting-a-reference-to-each-request-from-within-any-plugin-hook\n');
delete Plugins.deprecatedHooksParams[hook];
}
}
if (data.hook && data.method) {