Modified field from non multiculture to multiculture. Now throws error when saving/updating

Backstory:
In the project we started of with a multifield for a block. Within this multifield were a text field which was not a multiculture field which we then made into multiculture field. The problem then where that the field were not updated so we manually deleted the field then readded it with same id within the backoffice. This worked locally so we did the same thing on the test server (Litium hosted). Now the fields have multiculture options when editing a block but when trying to save said block (or page) this error emerges

IWebLog exception 'Field with name 'VideoSlider' throws exception when persisting data.': 86f4d791-a5d4-4d15-83ed-fb45e032bb8e

Litium.FieldFramework.FieldFrameworkException: Field with name 'VideoSlider' throws exception when persisting data. ---> Litium.FieldFramework.FieldFrameworkException: Field with name 'YoutubeEmbedd' need culture information.
   at Litium.Application.FieldFramework.FieldTypes.MultiFieldOptionFieldMetadata.MultiFieldOptionField.PersistFieldDataInternal(Object item)
   at Litium.Application.AutoMapper.ValueResolvers.FieldDataPersistanceToFieldDataEntityValueResolver`4.Resolve(T source, TDataEntity destination, ICollection`1 destMember, ResolutionContext context)
   --- End of inner exception stack trace ---
   at Litium.Runtime.AutoMapper.AutoMapperExtensions.MapTo[TResult](Object source)
   at Litium.Application.Data.Batching.BatchDataProcessor`2.Update(T entity, DbContext dbContext, BatchData batchData, Action`1 postCommitAction)
   at Litium.Application.Data.Batching.BatchDataImpl.Execute[T](T entity, ValidationMode validationMode)
   at Litium.Application.Blocks.DraftBlockServiceImpl.Update(DraftBlock draftBlock)
   at Litium.Web.Administration.WebApi.Blocks.EditorHandlers.BlockFieldsEditorHandler.Save(FormFieldList model)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Litium.Web.Administration.WebApi.Common.Controllers.ObjectSchemaController.<Save>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Tracing.Tracers.HttpControllerTracer.<ExecuteAsyncCore>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()

Field definition in question looks like this:

private IEnumerable<FieldDefinition> VideoSliderFields()
        {
            var fields = new List<FieldDefinition>
            {
                new FieldDefinition<BlockArea>(BlockFieldNameConstants.YoutubeEmbedd, SystemFieldTypeConstants.Text)
                {
                    MultiCulture = true
                },
                new FieldDefinition<BlockArea>(BlockFieldNameConstants.VideoSlider, SystemFieldTypeConstants.MultiField)
                {
                    Option = new MultiFieldOption { IsArray = true, Fields = new List<string>(){ BlockFieldNameConstants.BlockTitle, BlockFieldNameConstants.LinkText, BlockFieldNameConstants.BlockText, BlockFieldNameConstants.YoutubeEmbedd, BlockFieldNameConstants.URLLink } }
                },
            };
            return fields;
        }

We alse enforce Templates updates and field updates by doing this

       private void InitFields(IEnumerable<FieldDefinition> fields)
        {
            foreach (var item in fields)
            {
                if (IsAlreadyExecuted<FieldDefinition>(item.Id, item.AreaType.Name) &&
                    item.AreaType.Name != "ProductArea" &&
                    item.AreaType.Name != "WebsiteArea" &&
                    item.AreaType.Name != "BlockArea")
                {
                    continue;
                }
                var currentField = _fieldDefinitionService.Get(item.AreaType, item.Id);
                if (currentField == null)
                {
                    _fieldFrameworkSetupLocalizationService.Localize(item);
                    _fieldDefinitionService.Create(item);
                    SetAlreadyExecuted<FieldDefinition>(item.Id, item.AreaType.Name);
                    continue;
                }
                else if (item.AreaType.Name == "BlockArea" || item.AreaType.Name == "ProductArea" || item.AreaType.Name == "WebSiteArea")
                {
                    currentField = currentField.MakeWritableClone();
                    _fieldFrameworkSetupLocalizationService.Localize(currentField);
                    _fieldDefinitionService.Update(currentField);
                }
                if (item.FieldType != currentField.FieldType)
                {
                    _logger.LogError($"Accelerator \"{item.Id}\" field with \"{item.FieldType}\" type can't be created. The system already has the \"{currentField.Id}\" field with \"{currentField.FieldType}\" type. Accelerator deployment would fail.");
                    DefinitionsError = true;
                    continue;
                }
                if (item.MultiCulture != currentField.MultiCulture)
                {
                    _logger.LogError($"Accelerator \"{item.Id}\" field with \"MultiCulture\" setting and \"{item.MultiCulture}\" value can't be created. The system already has the \"{currentField.Id}\" field with \"MultiCulture\" setting and \"{currentField.MultiCulture}\" value. Accelerator deployment would fail.");
                    DefinitionsError = true;
                    continue;
                }
                SetAlreadyExecuted<FieldDefinition>(item.Id, item.AreaType.Name);
            }
        }
private void InitTemplates(IEnumerable<FieldTemplate> templates)
        {
            foreach (var item in templates)
            {
                if (IsAlreadyExecuted<FieldTemplate>(item.Id, item.AreaType.Name)
                    && item.AreaType.Name != "BlockArea" &&
                    item.Id != "ProductWithOneVariant" &&
                    item.Id != "ProductWithVariants" &&
                    item.Id != "ProductWithVariantsList" &&
                    item.Id != "Category" &&
                    item.Id != "ProductList" &&
                    item.AreaType.Name != "ProductArea" &&
                    item.AreaType.Name != "WebsiteArea")
                {
                    continue;
                }

                var currentField = _fieldTemplateService.Get<FieldTemplate>(item.AreaType, item.Id);
                try
                {
                    _fieldFrameworkSetupLocalizationService.Localize(item, ((dynamic)item).FieldGroups as ICollection<FieldTemplateFieldGroup>);
                }
                catch
                {
                    _fieldFrameworkSetupLocalizationService.Localize(item);
                }

                if (currentField == null)
                {
                    _fieldTemplateService.Create(item);
                }
                else
                {
                    item.SystemId = currentField.SystemId;
                    _fieldTemplateService.Update(item);
                }

                SetAlreadyExecuted<FieldTemplate>(item.Id, item.AreaType.Name);
            }
        }

This error is in the console on the edit page

ERROR TypeError: "t.error.submitFormField.byId is undefined"
    ngOnInit http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2188
    _next http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    next http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _next http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    next http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    notifyNext http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _next http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    next http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    n http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:1
    A http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    r http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    dispatch http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    submitForm http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2188
    __tryOrUnsub http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    notifyError http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    notifyError http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    o http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    _trySubscribe http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    subscribe http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    f http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    i http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    error http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2193
    l http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:276
    invokeTask http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2215
    onInvokeTask http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:1521
    invokeTask http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2215
    runTask http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2215
    invokeTask http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2215
    y http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2246
    g http://obhnordica.test.workplace.nu/Litium/Client/Scripts/dist/vendor.js?v=F96C893ED1E4F2DA51DBC10BF421F746BC8B12A755587825EFCC37DA8C62DFA3:2246

Litium version: 7.2

Did you restart the site after and check?

I did a restart on the site from the IIS but sadly that didn’t help. If that’s what you meant :smile:

Yes right, I think you have some inconsistent data in the DB then somehow. Create a support ticket so support can take a look at your tables, in the mean time you can create new fields with new Ids and try.

I tried a new field but that didn’t work. I’ve now contacted the support for further assistance.
Thank you for your help :smile:

Hi I looked at you DB and could actually solve the problem from BO.
Delete your fields first, you have 2 identical Ids (YouTubeURL) and also (YouTubeEmbedd).
Then go to your multifield (VideoSlider) and delete those “empty no name fields”.
Now they are all gone create new fields and add to your Multifield as you wish.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.