fix #5717: add sync events when importing settings

Fixes #5717 by adding a sync event for each added/updated setting in the import process.
This commit is contained in:
David Montesinos
2025-10-15 11:04:23 +02:00
committed by GitHub
parent 2648887f7d
commit 8bac8677c5

View File

@@ -366,13 +366,16 @@ namespace Oqtane.Controllers
var setting = _settings.GetSetting(cols[0], entityId, cols[2]); var setting = _settings.GetSetting(cols[0], entityId, cols[2]);
if (setting == null) if (setting == null)
{ {
_settings.AddSetting(new Setting { EntityName = cols[0], EntityId = entityId, SettingName = cols[2], SettingValue = cols[3], IsPrivate = isPrivate }); setting = new Setting { EntityName = cols[0], EntityId = entityId, SettingName = cols[2], SettingValue = cols[3], IsPrivate = isPrivate };
_settings.AddSetting(setting);
AddSyncEvent(setting.EntityName, setting.EntityId, setting.SettingId, SyncEventActions.Create);
} }
else else
{ {
setting.SettingValue = cols[3]; setting.SettingValue = cols[3];
setting.IsPrivate = isPrivate; setting.IsPrivate = isPrivate;
_settings.UpdateSetting(setting); _settings.UpdateSetting(setting);
AddSyncEvent(setting.EntityName, setting.EntityId, setting.SettingId, SyncEventActions.Update);
} }
rows++; rows++;
} }