mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
Fix defaultPlugins logic to parse the incoming value
This commit is contained in:
@@ -485,10 +485,17 @@ function enableDefaultPlugins(next) {
|
||||
'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