From 3e0948d04e35768e97884ecf1ab22182620214df Mon Sep 17 00:00:00 2001 From: Rish Date: Thu, 15 Oct 2020 15:32:05 +0530 Subject: [PATCH] Ignored member email settings in import no issue - Member email settings - newsletter and support - was previously being set to null for all cases, which can lead to `null` values being set for those addresses on a successful import whereas the expected behavior is to retain the old values. - Adds the 2 email settings to ignored settings list so they are not changed during import process --- core/server/data/importer/importers/data/settings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/server/data/importer/importers/data/settings.js b/core/server/data/importer/importers/data/settings.js index 0846d21201..f1f41eca62 100644 --- a/core/server/data/importer/importers/data/settings.js +++ b/core/server/data/importer/importers/data/settings.js @@ -8,7 +8,7 @@ const keyGroupMapper = require('../../../../api/shared/serializers/input/utils/s const keyTypeMapper = require('../../../../api/shared/serializers/input/utils/settings-key-type-mapper'); const labsDefaults = JSON.parse(defaultSettings.labs.labs.defaultValue); -const ignoredSettings = ['active_apps', 'installed_apps']; +const ignoredSettings = ['active_apps', 'installed_apps', 'members_from_address', 'members_support_address']; const deprecatedSupportedSettingsMap = { default_locale: 'lang', active_timezone: 'timezone', @@ -75,7 +75,7 @@ class SettingsImporter extends BaseImporter { }); } - // Don't import any old, deprecated settings + // Don't import any old, deprecated or excluded settings this.dataToImport = _.filter(this.dataToImport, (data) => { return !_.includes(ignoredSettings, data.key); }); @@ -110,7 +110,7 @@ class SettingsImporter extends BaseImporter { const oldIsPrivate = _.find(this.existingData, {key: 'is_private'}); this.dataToImport = _.filter(this.dataToImport, (data) => { - return data.key !== 'is_private'; + return !_.includes([['is_private']], data.key); }); this.dataToImport = _.filter(this.dataToImport, (data) => {