Copied to clipboard

Flag this post as spam?

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


  • Mustufa Baig 19 posts 41 karma points
    Jan 20, 2011 @ 02:31
    Mustufa Baig
    1

    Courier does not work when UComponent is installed

    win2k3, iis6, umbraco 4.5.2, ucomponents 2.0.1, courier 1.3, .net 3.5

    Hi There,

    I am developing a website which uses ucomponenets 2.0. I recently installed Courier 1.3 and started getting the following exception when i click on the nodes which has multi tree picker datatype on it. I can confirm that courier and ucomponent cannot get along because I have tried courier on a fresh install of umbarco 4.5.2 and it was working until i installed ucomponents 2.0.

    Index must be within the bounds of the List.
    Parameter name: index
    [ArgumentOutOfRangeException: Index must be within the bounds of the List.
    Parameter name: index]
       System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +72
       System.Collections.Generic.List`1.Insert(Int32 index, T item) +10414687
       Umbraco.Courier.BusinessLogic.Tree.ContextMenuHelper.BaseTree_NodeActionsCreated(Object sender, NodeActionsEventArgs e) +490
       umbraco.cms.presentation.Trees.BaseTree.OnNodeActionsCreated(NodeActionsEventArgs e) +130
       umbraco.cms.presentation.Trees.BaseTree.CreateAllowedActions(List`1& actions) +170
       umbraco.cms.presentation.Trees.BaseTree.CreateAllowedActions() +68
       umbraco.cms.presentation.Trees.BaseTree.Initialize() +109
       umbraco.cms.presentation.Trees.BaseTree.get_RootNode() +50
       umbraco.cms.presentation.Trees.BaseTree.SetTreeParameters(ITreeService treeParams) +674
       umbraco.controls.Tree.TreeControl.Initialize() +881
       umbraco.controls.Tree.TreeControl.OnPreRender(EventArgs e) +174


    Please provide a solution because otherwise Courier would become useless for me

    thanks
    Mustufa

  • Antony Briggs 78 posts 103 karma points
    Jan 20, 2011 @ 15:50
    Antony Briggs
    0

    Hi Mustufa,

    I've seen this issue come up before (in this forum I think), but don't remember seeing a resolution. is quite an easy fix, but does required recompiling either Courier or uComponents.

    You need run the site without Courrier and see what uComponents is changing in the context menu of the Content Tree. Look for either NodeActionsCreated as Cuorier used above, or I've used BeforeNodeRender in my code.

    Basically, Courier is looking for a menu item to insert it's context menu after (or before) and uComponents has upset it.

    Sorry for being a bit wooly, but I'm not working on any umbraco projects ATM and all my Umbraco knowledge seems to drip out of my ears like candle wax if not used for a while.

     

  • Mustufa Baig 19 posts 41 karma points
    Jan 20, 2011 @ 18:46
    Mustufa Baig
    0

    Antony:

    Your explanation does make sense because UComponent has a MultiNodeTree Picker which uses TreeServiceUrl to render its tree. I also observed that it removes all the context menu items. So when you right click on one of the nodes of the multinode tree picker its empty.

    So based on your explanation, Courier is trying to hook up its node action at a certain index where that does not exists anymore.

    Recompiling courier is not possible as its not open source product. The only option is recompiling UComponents.

    Based on your knowledge umbraco do you have any more ideas or directions you can give me? Appreciate it.

    thanks so much.

     

  • Antony Briggs 78 posts 103 karma points
    Jan 20, 2011 @ 20:18
    Antony Briggs
    0

    Ok, I see three possibilities:

    1) Do a custom compile of Umbraco 4.5.2 and add a try catch around the event call in BaseTree.OnNodeActionsCreated(). Log and swallow the error. (Easyest, but least satisfying)

    2) Find out which menu item Courier is trying to hook up next to and prevent uComponets from removing that item. (Will leave context menu items that aren't appropriate)

    3) There are several events that you can hook into/methods you can override in the tree provider in order to mess with the context menu. See if you can move uComponents to somwhere where it can get called after Courier's code. (Will require investigation but best result)

    Like I said, somone else has raised this issue in Courier's context menu injection code so it might be easyest to implement option 1 and report the bug to Niels and the team and hope they fix it before the next version of umbraco is released.

    TTFN

    Ant

  • Mustufa Baig 19 posts 41 karma points
    Jan 22, 2011 @ 19:29
    Mustufa Baig
    0

    So i ended up wrapping the onNodeActionCreated raise event around the try catch inside umbraco BaseTree class which kind of get me going...

    protected virtual void OnNodeActionsCreated(NodeActionsEventArgs e)
            {
                if (NodeActionsCreated != null)
                {
                    // wrapped it around try/catch because of problem with courier and ucomponent multi node datatype
                    // basically causing exception.
                    try
                    {
                        NodeActionsCreated(this, e);
                    }
                    catch (Exception)
                    {}               
                }
            }

    As so mentioned not a preferred solution but I can get by for now

    Thanks for your help and guidance.

  • Qube 74 posts 116 karma points
    Jan 22, 2011 @ 22:35
    Qube
    0

    Good to see a work-around, but I should re-iterate (as I did here) that this is not uComponents specific!

    uComponents Mutli-Node Tree Picker is affected to be sure, but the so is the standard Content Picker that ships with Umbraco. In other words, a premium extension breaks an out-of-the box feature! It's what Courier does to content trees without a menu (such as a picker dialog) that's the problem here.

    Again, I only stress this because support will always point to third party components as the cause. But take uComponents away and use a Content Picker data type and you'll have exactly the same issue.

  • Mustufa Baig 19 posts 41 karma points
    Jan 23, 2011 @ 16:40
    Mustufa Baig
    0

    I agree because as Antony mentioned courier tries to insert its menu item at a certain index which causes an exception because menu object is null.

    I reported umbraco team about this issue and they replied that they do not support 3rd party components.

  • Martin Griffiths 826 posts 1269 karma points c-trib
    Mar 14, 2013 @ 16:09
    Martin Griffiths
    0

    This is a bit of a long-shot as the last post here was over 2 years ago. But I was wondering if everyone one here has successfully moved onto Courier 2? I was also wondering what experiences your experiences have been like if you have moved on.

    I've continued to patch up the umbraco.dll to allow courier 1.3 to work in Umbraco 4.xx.xx and my own exprience with Courier 2 has been less than stellar!

    Would really appreciate some feedback.

    Martin

Please Sign in or register to post replies

Write your reply to:

Draft