|
|
@ -4,10 +4,11 @@ var winston = require('winston'),
|
|
|
|
async = require('async');
|
|
|
|
async = require('async');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function(Plugins) {
|
|
|
|
module.exports = function(Plugins) {
|
|
|
|
Plugins.deprecatedHooks = [
|
|
|
|
Plugins.deprecatedHooks = {
|
|
|
|
'filter:user.delete',
|
|
|
|
'filter:user.delete': 'static:user.delete',
|
|
|
|
'filter:user.custom_fields'
|
|
|
|
'filter:user.custom_fields': null,
|
|
|
|
];
|
|
|
|
'action:user.loggedOut': 'static:user.loggedOut'
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
`data` is an object consisting of (* is required):
|
|
|
|
`data` is an object consisting of (* is required):
|
|
|
@ -27,8 +28,13 @@ module.exports = function(Plugins) {
|
|
|
|
|
|
|
|
|
|
|
|
var method;
|
|
|
|
var method;
|
|
|
|
|
|
|
|
|
|
|
|
if (Plugins.deprecatedHooks.indexOf(data.hook) !== -1) {
|
|
|
|
if (Object.keys(Plugins.deprecatedHooks).indexOf(data.hook) !== -1) {
|
|
|
|
winston.warn('[plugins/' + id + '] Hook `' + data.hook + '` is deprecated, please use an alternative');
|
|
|
|
winston.warn('[plugins/' + id + '] Hook `' + data.hook + '` is deprecated, ' +
|
|
|
|
|
|
|
|
(Plugins.deprecatedHooks[data.hook] ?
|
|
|
|
|
|
|
|
'please use `' + Plugins.deprecatedHooks[data.hook] + '` instead.' :
|
|
|
|
|
|
|
|
'there is no alternative.'
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (data.hook && data.method) {
|
|
|
|
if (data.hook && data.method) {
|
|
|
|