Copied to clipboard

Flag this post as spam?

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


  • Jesper Hauge 298 posts 487 karma points c-trib
    Feb 02, 2010 @ 11:41
    Jesper Hauge
    0

    Item with the same key already added

    Trying to do a simple xml import, set up an xml file with following structure:

    <root>
      <contact>
        <nodename>Torben Schmidt</nodename>
        <name>Torben Schmidt</name>
        <address></address>
        <zip></zip>
        <city></city>
        <country></country>
        <location>Jylland og Fyn</location>
        <bphone>+45 2028 4355</bphone>
        <dphone></dphone>
        <mphone></mphone>
        <wmail><![CDATA[[email protected]]]></wmail>
        <pmail><![CDATA[]]></pmail>
        <pic><![CDATA[1224]]></pic>
      </contact>
      ..
    </root>

    Then doing an import and mapping nodename to name at the top of the mapping form, and other fields to corresponding fields for doctype, There is no duplicate nodename tags (it's an export from an old site), but I get the following error every time i try none the less:

    [ArgumentException: An item with the same key has already been added.]
       System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +56
       System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +10416334
       System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) +12
       UmbImport.ImportSteps.MapProperties.UpdateState(ImportState state) +269
       UmbImport.UmbImport.UpdateState() +73
       UmbImport.UmbImport.NextButton_Click(Object sender, EventArgs e) +16
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
    

    Anybody got any ideas what's happening?

    Regards
    Jesper Hauge

  • Richard Soeteman 4036 posts 12863 karma points MVP
    Feb 02, 2010 @ 12:03
    Richard Soeteman
    0

    Hi Jesper,

    This is a bug in the current version indeed, Is it possible to change the name element to person? nodename and name are identical for UmbImport, sorry about that. Will be fixed in 1.0.3.

    Cheers,

    Richard

  • Jesper Hauge 298 posts 487 karma points c-trib
    Feb 02, 2010 @ 12:18
    Jesper Hauge
    0

    Hi Richard

    Just figured that one out myself :) Changed the property alias for the name property to fullName, and the import ran as expected, I can change the property alias back after import, since this is going to be an one-time only import.

    Cheers
    Jesper Hauge

  • Richard Soeteman 4036 posts 12863 karma points MVP
    Feb 18, 2010 @ 12:36
    Richard Soeteman
    0

    Hi Jesper,

    This bug is solved now and can be downloaded from  http://our.umbraco.org/projects/cmsimport  Please note that we changed the name from UmbImport to CMSImport

    Cheers,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft