using EPiServer.Framework.Initialization; using EPiServer.Framework; using EPiServer.ServiceLocation; using EPiServer.Forms.Core.Internal; using EPiServer.Forms.Core.Models; using EPiServer.Data; namespace UiLocalizationIssue.Business { public class CustomDataSubmissionService : DataSubmissionService { public override Guid StoreSubmissionData(string sFormSubmissionId, FormIdentity formIden, Submission submission) { //Check if the DB is ReadOnly mode, it will return a new id, to avoid the form prenvent submitting the form. The actors still be performed. var isReadonlyMode = (_databaseMode.Service.DatabaseMode == DatabaseMode.ReadOnly); if (isReadonlyMode) { return Guid.NewGuid(); } return base.StoreSubmissionData(sFormSubmissionId, formIden, submission); } } [InitializableModule] public class FormsInitialization : IConfigurableModule { public void ConfigureContainer(ServiceConfigurationContext context) { context.ConfigurationComplete += (o, e) => { context.Services.AddSingleton(); }; } public void Initialize(InitializationEngine context) { } public void Uninitialize(InitializationEngine context) { } } }