mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +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-rewards-essentials',
|
||||||
'nodebb-plugin-soundpack-default',
|
'nodebb-plugin-soundpack-default',
|
||||||
'nodebb-plugin-emoji-extended'
|
'nodebb-plugin-emoji-extended'
|
||||||
];
|
],
|
||||||
|
customDefaults = nconf.get('defaultPlugins');
|
||||||
|
|
||||||
if (Array.isArray(nconf.get('defaultPlugins'))) {
|
if (customDefaults && customDefaults.length) {
|
||||||
defaultEnabled = defaultEnabled.concat(nconf.get('defaultPlugins'));
|
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) {
|
defaultEnabled = defaultEnabled.filter(function(plugin, index, array) {
|
||||||
|
|||||||
Reference in New Issue
Block a user