Error trying to import BlogPostComments for blogforUmbraco4
I received the following error while trying to import BlogPostComments via XML using the UmbImport. The error occurred after I mapped the XML fields to the Document Fields. On previous uses with other Document Types I received a confirmation screen, but in this case an error was thrown. I don't want to post my data, but I can send you a sample if you are unable to re-create the issue.
Umbraco Version: 4.0.2.1 ASP.Net 3.5 Windows Server 2008, IIS 7
StackTrace:
[ArgumentException: An item with the same key has already been added.] System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +51 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +7462172 UmbImport.ImportSteps.MapProperties.UpdateState(ImportState state) +192 UmbImport.UmbImport.UpdateState() +56 UmbImport.UmbImport.NextButton_Click(Object sender, EventArgs e) +13 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
I'll do that if my next effort doesn't work. I see that in the BlogPostComment there are two fields called "Name". The Name of the Document and the Name of the Author. Let me try to rename one of those fields and see if that works.
The issue appears to be both the Name and the Email fields for that Document Type. I assume the alias' used are also used for some hidden fields. If I change the alias as follows the import seems to work: name -> commentAuthor; email -> commentEmail. Now I just have to make sure that those changes don't affect any of the functionality of the Blog (i.e. I'll probably need to update the templates and XSLT files in the least).
Indeed, if there is a duplicate named property the error 'An item with the same key has already been added' will be generated. In my case there was a user defined property 'name' in addition to the Umbraco default 'name' property - once the user defined property was renamed, all was good.
I know its a lot to ask, but for a future version it would be great to trap this error and warn the user...among many others I'm sure.
Error trying to import BlogPostComments for blogforUmbraco4
I received the following error while trying to import BlogPostComments via XML using the UmbImport. The error occurred after I mapped the XML fields to the Document Fields. On previous uses with other Document Types I received a confirmation screen, but in this case an error was thrown. I don't want to post my data, but I can send you a sample if you are unable to re-create the issue.
Umbraco Version: 4.0.2.1
ASP.Net 3.5
Windows Server 2008, IIS 7
StackTrace:
Hi again,
I'm intersested in two things:
1. The column of your datasource that you want to map?
2. The documenttype properties Name and Alias that you want to map?
Cheers,
Richard
I'll do that if my next effort doesn't work. I see that in the BlogPostComment there are two fields called "Name". The Name of the Document and the Name of the Author. Let me try to rename one of those fields and see if that works.
The issue appears to be both the Name and the Email fields for that Document Type. I assume the alias' used are also used for some hidden fields. If I change the alias as follows the import seems to work: name -> commentAuthor; email -> commentEmail. Now I just have to make sure that those changes don't affect any of the functionality of the Blog (i.e. I'll probably need to update the templates and XSLT files in the least).
Richard -
Indeed, if there is a duplicate named property the error 'An item with the same key has already been added' will be generated. In my case there was a user defined property 'name' in addition to the Umbraco default 'name' property - once the user defined property was renamed, all was good.
I know its a lot to ask, but for a future version it would be great to trap this error and warn the user...among many others I'm sure.
-Paul
Hi Paul and others,
This issue is fixed in the 1.0.3 release. I'm currently testing this and hope to release it (very) soon.
Cheers,
Richard
Richard -
The beta of 1.0.3 that you provided does, indeed, fix this issue.
Thanks!
-Paul
Too bad 1.03 is not yet available. But the tip to rename the fields helped me out for now. thanks Paul
is working on a reply...