Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tim Watts 90 posts 392 karma points
    Oct 24, 2017 @ 15:18
    Tim Watts
    0

    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.

    Regards,

    Tim

  • Dave Woestenborghs 3272 posts 11111 karma points MVP 5x admin c-trib
    Oct 24, 2017 @ 17:23
    Dave Woestenborghs
    0

    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

  • Tim Watts 90 posts 392 karma points
    Oct 24, 2017 @ 17:43
    Tim Watts
    0

    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

  • Dave Woestenborghs 3272 posts 11111 karma points MVP 5x admin c-trib
    Mar 15, 2018 @ 10:22
    Dave Woestenborghs
    100

    Hi Tim,

    This has been fixed in the latest beta release. You are more than welcome to test it.

    Dave

  • Dave Woestenborghs 3272 posts 11111 karma points MVP 5x admin c-trib
    Apr 04, 2018 @ 09:13
    Dave Woestenborghs
    0

    Version 1.5.0 is released today and this fixes this issue

Please Sign in or register to post replies

Write your reply to:

Draft