Copied to clipboard

Flag this post as spam?

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


  • Richard Thompson 100 posts 336 karma points
    Aug 19, 2016 @ 09:33
    Richard Thompson
    0

    An item with the same key has already been added Umbraco 7.5

    After upgrading my site from 7.4.3 to 7.5 I get the following error:

    [ArgumentException: An item with the same key has already been added.]
    

    Some pages work it just seems to be pages where I'm getting descendants that have the problem.

    var newsItems2 = Model.Content.Descendants("Newsitem");
    var newsItems2Count = newsItems2.Count();
    

    It's the second line apparently where it falls over.

    I've tried republishing all the content but this hasn't helped.

  • Simon Thorpe 3 posts 23 karma points
    Nov 02, 2016 @ 16:47
    Simon Thorpe
    0

    I'm getting the same issue after an update from 7.4 to 7.5.4.

    The lines that I get the issue with are related to both getting parent and child URLs.

    Line 41:             writer.WritePropertyName("path");
    Line 42:             writer.WriteValue((string)parentInfo.Url); 
    
    Line 63:             writer.WritePropertyName("path");
    Line 64:             writer.WriteValue(item.Url);
    

    It must be something to do with the upgrade/version but not sure what at the moment.

  • Richard Thompson 100 posts 336 karma points
    Nov 02, 2016 @ 16:53
    Richard Thompson
    0

    I tracked this down to a duplicate property on a document type in the end because of a casing difference http://issues.umbraco.org/issue/U4-8905

  • Dallas 132 posts 404 karma points
    Feb 08, 2017 @ 15:41
    Dallas
    0

    Richard, thank you for sharing what you found. We encountered the same error after upgrading to 7.5 and you have saved us a lot of time.

    Our error was caused by a duplicate property alias with different casing. If anyone else is getting this error you can confirm that there is a duplicate property and find the document type that has the duplicate property alias with this sql:

    SELECT cct.[alias], [contentTypeId], cpt.[alias], count(cpt.[Alias])
    FROM [cmsPropertyType] cpt JOIN [cmsContentType] cct on cpt.contentTypeId = cct.nodeId
    GROUP BY cct.[alias], [contentTypeId], cpt.[alias]
    HAVING COUNT(cpt.[alias]) > 1
    

    Dallas

Please Sign in or register to post replies

Write your reply to:

Draft