mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	fix for multiple synchronous hooks (synchronous hooks to be deprecated in 0.4x)
This commit is contained in:
		| @@ -317,15 +317,15 @@ var fs = require('fs'), | |||||||
| 									next(arguments[0], Array.prototype.slice.call(arguments, 1)); | 									next(arguments[0], Array.prototype.slice.call(arguments, 1)); | ||||||
| 								})); | 								})); | ||||||
| 							} else { | 							} else { | ||||||
| 								winston.warn('[plugins] "callbacked" property deprecated as of 0.4x. Use asynchronous method instead for hook: ' + hook); | 								winston.warn('[plugins] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: ' + hook); | ||||||
| 								value = hookObj.method.apply(Plugins, value); | 								value = hookObj.method.apply(Plugins, value); | ||||||
| 								next(null, value); | 								next(null, [value]); | ||||||
| 							} | 							} | ||||||
| 						} else { | 						} else { | ||||||
| 							if (global.env === 'development') { | 							if (global.env === 'development') { | ||||||
| 								winston.info('[plugins] Expected method for hook \'' + hook + '\' in plugin \'' + hookObj.id + '\' not found, skipping.'); | 								winston.info('[plugins] Expected method for hook \'' + hook + '\' in plugin \'' + hookObj.id + '\' not found, skipping.'); | ||||||
| 							} | 							} | ||||||
| 							next(null, value); | 							next(null, [value]); | ||||||
| 						} | 						} | ||||||
| 					}, function(err, values) { | 					}, function(err, values) { | ||||||
| 						if (err) { | 						if (err) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user