Copied to clipboard

Flag this post as spam?

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


  • Andrew Munro 78 posts 161 karma points
    Feb 19, 2013 @ 19:12
    Andrew Munro
    0

    No node exists with id '0' when accessing properties from DynamicNode

    Hi Guys - I'm having an issue pulling properties from DynamicNodes that results in the above error. I'm calling this code from a UserControl codebehind page. The code itself is very simple. It loops though a nodes children to determine how many children per column. I'm hoping that I am just doing something silly and someone can point out the obvious. Thanks!

    private void AnalyzeGroupColumnCounts()
    {
        dynamic dnModel = new DynamicNode(Node.getCurrentNodeId());
        int iGroupCounter = 0;
        foreach (dynamic dChild in dnModel.Children)
        {
            // if the max index is less than the curent index
            // we need add a 0 int as we will be incrementing it next
            if ((GroupColCounts.Count - 1) <= iGroupCounter)
                GroupColCounts.Add(0);
    
            //increment the col count on the current group
            GroupColCounts[iGroupCounter]++;
                    if (dChild.endsGroup)//if the group ends, move onto the next group
                iGroupCounter++;
        }
    }

    The line with the problem is this:

    if (dChild.endsGroup)
  • Andrew Munro 78 posts 161 karma points
    Feb 20, 2013 @ 15:19
    Andrew Munro
    100

    Oddly enough, once I deleted the children and created them again everything worked fine. I'm sure there is a bug in there but I'm not sure how to reproduce it or even report it :P.

  • Andreas Iseli 150 posts 427 karma points
    Feb 21, 2013 @ 10:59
    Andreas Iseli
    0

    If you achieve to reproduce the bug, you can create an issue here:

    http://issues.umbraco.org

    Just have a look first if there doesn't exist yet a similar bug report or that the bug already has been fixed for a next version.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies