Skip to content

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

@nolmsted

Description

@nolmsted

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions