Skip to content

Composition tabs getting added to content types using composition #862

@arknu

Description

@arknu

I have a composition like this:

<?xml version="1.0" encoding="utf-8"?>
<ContentType Key="8db42aba-83ae-4633-9c2f-ae89a4bace27" Alias="topImage" Level="2">
  <Info>
    ...
  </Info>
  <Structure />
  <GenericProperties>
    ....
  </GenericProperties>
  <Tabs>
    <Tab>
      <Key>a84e3053-5f85-4302-95cb-f35f6710eeb0</Key>
      <Caption>Indhold</Caption>
      <Alias>indhold</Alias>
      <Type>Tab</Type>
      <SortOrder>5</SortOrder>
    </Tab>
  </Tabs>
</ContentType>

Since v16 it seems that these tabs are also added to any content types using this composition.

Image

This is diff of doing an export in v16, showing how the tab from the composition is now added to pages using this composition as well.

This then results in this error on import:

Image

uSync version 16.1.0 on Umbraco 16.4.0-rc

The site is also running uSync.Complete.

This is the full exception:

["ContentTypeHandler"] ImportElement Failed : "System.ArgumentException: An item with the same key has already been added. Key: indhold at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem item) at System.Collections.ObjectModel.KeyedCollection`2.ChangeItemKey(TItem item, TKey newKey) at Umbraco.Cms.Core.Models.PropertyGroupCollection.ChangeKey(PropertyGroup item, String newKey) at Umbraco.Cms.Core.Models.PropertyGroup.set_Alias(String value) at uSync.Core.Serialization.Serializers.ContentTypeBaseSerializer`1.DeserializeTabs(TObject item, XElement node) at uSync.Core.Serialization.Serializers.ContentTypeSerializer.DeserializeCoreAsync(XElement node, SyncSerializerOptions options) at uSync.Core.Serialization.SyncSerializerRoot`1.DeserializeAsync(XElement node, SyncSerializerOptions options) at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.DeserializeItemAsync(XElement node, SyncSerializerOptions options) at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.ImportElementAsync(XElement node, String filename, HandlerSettings settings, uSyncImportOptions options)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions