Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error importing content/media types with custom tabs - "Set an alias before adding the property group" #289

Open
nolmsted opened this issue Oct 23, 2024 · 0 comments

Comments

@nolmsted
Copy link

nolmsted commented Oct 23, 2024

I'm performing a migration on a v8 site and seeing the following errors when content & media types with custom tabs are being imported after conversion. It appears this only occurs with types that already exist; e.g. updating media types fails but content types will work on an initial import, but fail on subsequent attempts

[[09:43:24 WRN] ContentTypeHandler: Import Failed : System.InvalidOperationException: Set an alias before adding the property group.
   at Umbraco.Cms.Core.Models.PropertyGroupCollection.Add(PropertyGroup item)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.MapGroupsAndProperties(IDictionary`2 contentTypes)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.GetAllTypesInternal()
   at Umbraco.Extensions.AppCacheExtensions.<>c__DisplayClass0_0`1.<GetCacheItem>b__0()
   at Umbraco.Cms.Core.Cache.SafeLazy.<>c__DisplayClass1_0.<GetSafeLazy>b__0()
--- End of stack trace from previous location ---
   at Umbraco.Cms.Core.Cache.ObjectCacheAppCache.Get(String key, Func`1 factory, Nullable`1 timeout, Boolean isSliding, String[] dependentFiles)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.PerformGetAll(Int32[] ids)
   at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy`2.GetAllCached(Func`2 performGetAll)
   at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy`2.GetAll(TId[] ids, Func`2 performGetAll)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.EntityRepositoryBase`2.GetMany(TId[] ids)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeRepository.PerformGet(Guid id)
   at Umbraco.Cms.Core.Services.ContentTypeServiceBase`2.Get(Guid id)
   at uSync.Core.Serialization.SyncSerializerRoot`1.FindItem(XElement node)
   at uSync.Core.Serialization.SyncSerializerRoot`1.Deserialize(XElement node, SyncSerializerOptions options)
   at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.ImportElement(XElement node, String filename, HandlerSettings settings, uSyncImportOptions options)
[09:43:24 WRN] ContentTypeHandler: Import Failed : System.InvalidOperationException: Set an alias before adding the property group.
   at Umbraco.Cms.Core.Models.PropertyGroupCollection.Add(PropertyGroup item)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.MapGroupsAndProperties(IDictionary`2 contentTypes)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.GetAllTypesInternal()
   at Umbraco.Extensions.AppCacheExtensions.<>c__DisplayClass0_0`1.<GetCacheItem>b__0()
   at Umbraco.Cms.Core.Cache.SafeLazy.<>c__DisplayClass1_0.<GetSafeLazy>b__0()
--- End of stack trace from previous location ---
   at Umbraco.Cms.Core.Cache.ObjectCacheAppCache.Get(String key, Func`1 factory, Nullable`1 timeout, Boolean isSliding, String[] dependentFiles)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.PerformGetAll(Int32[] ids)
   at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy`2.GetAllCached(Func`2 performGetAll)
   at Umbraco.Cms.Core.Cache.FullDataSetRepositoryCachePolicy`2.GetAll(TId[] ids, Func`2 performGetAll)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.EntityRepositoryBase`2.GetMany(TId[] ids)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeRepository.PerformGet(Guid id)
   at Umbraco.Cms.Core.Services.ContentTypeServiceBase`2.Get(Guid id)
   at uSync.Core.Serialization.SyncSerializerRoot`1.FindItem(XElement node)
   at uSync.Core.Serialization.SyncSerializerRoot`1.Deserialize(XElement node, SyncSerializerOptions options)
   at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.ImportElement(XElement node, String filename, HandlerSettings settings, uSyncImportOptions options)

Example diff (in this case updating the svg media type)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant