Copied to clipboard

Flag this post as spam?

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


  • Fredrik Berggren 1 post 21 karma points
    Dec 05, 2014 @ 09:23
    Fredrik Berggren
    0

    GetNextNode and GetPreviusNode

    Hi

    The Listing.GetNextNode and Listing.GetPreviusNode Does not work as expected.

    If statements are as follows:
    NextNode
    if ((int) indexOf == nodeSiblings.Count - 1 || (int) indexOf == -1 || ((int) indexOf == 0 || (int) indexOf + 1 > nodeSiblings.Count))

            return (DynamicNode) null;

    PreviusNode
    if ((int) indexOf == nodeSiblings.Count + 1 || (int) indexOf == -1 || ((int) indexOf == 0 || (int) indexOf - 1 < nodeSiblings.Count))

    This means that no nextnode is present if we are on the first node which is wrong ofc And no previusNode is present if current node is smaller than siblings list which is wrong.

    The correct ones should look like this?

    NextNode
    if ((int) indexOf == nodeSiblings.Count - 1 || (int) indexOf == -1 || (int) indexOf + 1 > nodeSiblings.Count)
    return (DynamicNode) null;

    PreviusNode
    if ((int) indexOf == nodeSiblings.Count + 1 || (int) indexOf == -1 || ((int) indexOf == 0))

     

    Using SmartBlog 2.0.9 And Umbraco 7.07


Please Sign in or register to post replies

Write your reply to:

Draft