Copied to clipboard

Flag this post as spam?

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


  • Murray Roke 503 posts 966 karma points c-trib
    Dec 15, 2011 @ 05:29
    Murray Roke
    0

    Creating 2 MNTP on dashboard causes Exception

    Hi

    I've got 2 MNTP controls on a dashboard, to bulk copy / move content like so:

    <uComponents:MNTP_DataEditor id="SourceNodesInput" runat="server" 
                    StartNodeId="0" DataTypeDefinitionId="1199"  />   
    <uComponents:MNTP_DataEditor id="TargetNodesInput" runat="server" 
                    StartNodeId="0" DataTypeDefinitionId="2060"  />   

    These each make a request to TreeDataService like so:

    http://localhost:18438/umbraco/webservices/TreeDataService.ashx?rnd=d69b56eab70d4630be3119d671d33178&id=-1&treeType=FilteredContentTree&contextMenu=false&isDialog=true&dialogMode=id&nodeKey=1199&rnd2=70.2
    http://localhost:18438/umbraco/webservices/TreeDataService.ashx?rnd=7ddaf9e953d14666b88c72e3ab18bdb6&id=-1&treeType=FilteredContentTree&contextMenu=false&isDialog=true&dialogMode=id&nodeKey=2060&rnd2=71.2
    the first is OK
    the second returns 500 with this exception
    [ArgumentException: An item with the same key has already been added.]
    System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +52
    System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +9375355
    Umbraco.Courier.Core.Helpers.TypeFinder.FindClassesOfType(Boolean useSeperateAppDomain, Boolean onlyConcreteClasses) +283
    Umbraco.Courier.Core.Helpers.TypeFinder.FindClassesOfType(Boolean useSeperateAppDomain) +56
    Umbraco.Courier.Core.ProviderCollection`1.›() +295
    Umbraco.Courier.UI.CourierTasks.TreeEvent.•(XmlTree&amp; sender, XmlTreeNode&amp; node, EventArgs e) +518
    umbraco.cms.presentation.Trees.BaseTree.OnBeforeNodeRender(XmlTree&amp; sender, XmlTreeNode&amp; node, EventArgs e) +30
    umbraco.cms.presentation.Trees.BaseContentTree.Render(XmlTree&amp; Tree) +190
    umbraco.presentation.webservices.TreeDataService.LoadTree(TreeRequestParams treeParams) +74
    umbraco.presentation.webservices.TreeDataService.GetXmlTree() +140
    umbraco.presentation.webservices.TreeDataService.ProcessRequest(HttpContext context) +55
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75

    BUT if I request the failed TreeDataService.ashx AGAIN it works, (I assume because of a time related bug)

    Any ideas? should I report a bug?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Dec 15, 2011 @ 09:23
    Jeroen Breuer
    0

    Have you tried this wiki? http://our.umbraco.org/wiki/reference/code-snippets/use-mntp-on-a-usercontrol

    It's a different approach, but I've used it before and it works :).

    Jeroen

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Dec 15, 2011 @ 10:26
    Lee Kelleher
    0

    Hi Murray,

    Quite the edge case... curious what you're building - once your have it working, is it something you could share/release? (unless it's NDA'd client work?)

    While I don't have the answer, I'm not sure where the onus lies.  The exception is coming from Courier (via its OnBeforeNodeRender event handler) ... meaning that Courier is trying to add a dictionary key that already exists (surely a simple exists/contains check would resolve this matter).

    Not sure if there is anything we can do in uComponents to resolve this.  Although if there is anything we can do, then do let us know.

    Cheers, Lee.

  • Murray Roke 503 posts 966 karma points c-trib
    Mar 06, 2012 @ 04:19
    Murray Roke
    1

    Hi,

    This was on the back burner, but after upgrading to umbraco 4.7.1.1 and uComponents 3.0.2 the issues I've described above have gone away.

    As to what I'm building: It allows you to move one or many nodes to another location, or copy one or many nodes to one or many locations.

    In this case it's a multi-region site where they may, for example, select a news story to be copied to one or two other regions where it's relevant.

    Cheers, Murray.

Please Sign in or register to post replies

Write your reply to:

Draft