mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
Fix defaultPlugins logic to parse the incoming value
This commit is contained in:
@@ -478,17 +478,24 @@ function enableDefaultPlugins(next) {
|
||||
process.stdout.write('Enabling default plugins\n');
|
||||
|
||||
var defaultEnabled = [
|
||||
'nodebb-plugin-composer-default',
|
||||
'nodebb-plugin-markdown',
|
||||
'nodebb-plugin-mentions',
|
||||
'nodebb-widget-essentials',
|
||||
'nodebb-rewards-essentials',
|
||||
'nodebb-plugin-soundpack-default',
|
||||
'nodebb-plugin-emoji-extended'
|
||||
];
|
||||
'nodebb-plugin-composer-default',
|
||||
'nodebb-plugin-markdown',
|
||||
'nodebb-plugin-mentions',
|
||||
'nodebb-widget-essentials',
|
||||
'nodebb-rewards-essentials',
|
||||
'nodebb-plugin-soundpack-default',
|
||||
'nodebb-plugin-emoji-extended'
|
||||
],
|
||||
customDefaults = nconf.get('defaultPlugins');
|
||||
|
||||
if (Array.isArray(nconf.get('defaultPlugins'))) {
|
||||
defaultEnabled = defaultEnabled.concat(nconf.get('defaultPlugins'));
|
||||
if (customDefaults && customDefaults.length) {
|
||||
try {
|
||||
customDefaults = JSON.parse(customDefaults);
|
||||
defaultEnabled = defaultEnabled.concat(customDefaults);
|
||||
} catch (e) {
|
||||
// Invalid value received
|
||||
winston.warn('[install/enableDefaultPlugins] Invalid defaultPlugins value received. Ignoring.');
|
||||
}
|
||||
}
|
||||
|
||||
defaultEnabled = defaultEnabled.filter(function(plugin, index, array) {
|
||||
|
||||
Reference in New Issue
Block a user