We're trying to use uSync to standardise settings on some new V9.5.2 sites. Some of the document types were created separately on 2 sites before we found uSync, so now we're merging the uSync config files and importing. This has worked as expected apart from 1 file which throws the error:
An item with the same key has already been added. Key: settings
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
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.PropertyGroup.set_Alias(String value)
at uSync.Core.Serialization.Serializers.ContentTypeBaseSerializer`1.DeserializeTabs(TObject item, XElement node)
at uSync.Core.Serialization.Serializers.ContentTypeSerializer.DeserializeCore(XElement node, SyncSerializerOptions options)
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)
The issue seems to be it is trying to replace a key twice.
As you can see from the report it's wanting to change both the keys to be the same and change the group to a tab. We tried changing the group name in case that was causing a conflict and changing the order in the .config, but still the same results. We even tried altering the config file to remove the group and just leave the tab. We have other doctypes setup in the same way, which have merged without issue. Any ideas?
Thanks for the super fast reply; it pointed me in the right direction. There was another block doc type with a group with the same alias (settings). Changed both to something a bit more descriptive and hey presto!
uSync mixing up group and tab keys
Hi Kevin,
We're trying to use uSync to standardise settings on some new V9.5.2 sites. Some of the document types were created separately on 2 sites before we found uSync, so now we're merging the uSync config files and importing. This has worked as expected apart from 1 file which throws the error:
The issue seems to be it is trying to replace a key twice.
Old .config:
New .config:
Report:
As you can see from the report it's wanting to change both the keys to be the same and change the group to a tab. We tried changing the group name in case that was causing a conflict and changing the order in the .config, but still the same results. We even tried altering the config file to remove the group and just leave the tab. We have other doctypes setup in the same way, which have merged without issue. Any ideas?
Hi,
Yeah if you ar emerging two sites its probibly because of the mixture of tabs and groups in the sites.
internally inside umbraco you can't have a tab and a group have the same alias and key,
Looking at your files i think you have somehow ended up with that. the first one .
is a clash with the second.
I would try changing the key value on one of the files (e.g. change the end of the key 33 to 34 or something)
that or try a full export from the source, really the key/alias pairs should always be unique so its a little odd they have ended up not being.
Kevin
Thanks for the super fast reply; it pointed me in the right direction. There was another block doc type with a group with the same alias (settings). Changed both to something a bit more descriptive and hey presto!
Thanks again
is working on a reply...