duplicate key error when running initial relation build
Hi Dave,
I've just installed Nexu and started the initial build of relations. It doesn't get far before throwing an error which is written to the log as below:
2017-10-24 16:00:32,219 [P10652/D4/TNexuRebuildJob] ERROR Umbraco.Core.UmbracoApplicationBase - Unhandled exception in AppDomain (terminating)
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Our.Umbraco.Nexu.Core.NexuService.<>c__DisplayClass9_0.<GetLinkedEntitesForContent>b__0(PropertyWithParser pp) in C:\Users\twatts\Downloads\umbraco-nexu-develop\umbraco-nexu-develop\Source\Our.Umbraco.Nexu.Core\NexuService.cs:line 130
at System.Collections.Generic.List`1.ForEach(Action`1 action)
...
I've downloaded the source code and debugged the issue. The problem is caused because you are using the name of the property type as the dictionary key. The name does not need to be unique (unlike the alias obviously).
If I change the properties on the document type so that the names are unique then the relation rebuild seems to work fine.
Yes I have two properties on the same tab with the same name. They are separated by a Label property so there is a distinction made between them for the editors. And the different aliases gives the distinction for the developer.
duplicate key error when running initial relation build
Hi Dave,
I've just installed Nexu and started the initial build of relations. It doesn't get far before throwing an error which is written to the log as below:
I've downloaded the source code and debugged the issue. The problem is caused because you are using the name of the property type as the dictionary key. The name does not need to be unique (unlike the alias obviously).
If I change the properties on the document type so that the names are unique then the relation rebuild seems to work fine.
Regards,
Tim
Hi Tim,
Do I understand correctly, that you have 2 properties with the same name ? I have used this often. But on different tabs.
Dave
Hi Dave,
Yes I have two properties on the same tab with the same name. They are separated by a Label property so there is a distinction made between them for the editors. And the different aliases gives the distinction for the developer.
Umbraco let me do it!
Regards,
Tim
Hi Tim,
This has been fixed in the latest beta release. You are more than welcome to test it.
Dave
Version 1.5.0 is released today and this fixes this issue
is working on a reply...