Copied to clipboard

Flag this post as spam?

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


  • Ricardo Antunes 3 posts 83 karma points
    Jun 19, 2018 @ 22:44
    Ricardo Antunes
    0

    Index Out Of Range in Node Options Expansion

    Hi Nathan, I'm trying to create a project with your package, but i'm having a problem.

    I've created a user with Umbraco User Group "Writers", and when loged with this user, I can't see the options over any node created with this user, giving me the following error: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

    Can you give me some help with this problem?

    Thanks in advance for your help! Best regards,

    Ricardo Antunes

  • Nathan Woulfe 411 posts 1530 karma points MVP 3x c-trib
    Jun 20, 2018 @ 07:31
    Nathan Woulfe
    0

    Hi Ricardo

    Does the Writers group have limited permissions? IE would the context menu have a really small set of options?

    I think the issue here will be related to how I'm adding options to the context menu, probably need better checks around the insertion index being within the menu length.

    Can you provide any more detail (screenshots would be ideal)

    ta N

    EDIT - just had a quick look in the repo, if the error is happening where I think it is, your context menu might have exactly 5 items... Code checks for length < 5, but then access items[5], hence the out of range exception.

    Will fix this, hopefully that's the cause of your issue.

  • Ricardo Antunes 3 posts 83 karma points
    Jun 20, 2018 @ 11:11
    Ricardo Antunes
    0

    Hi Nathan, thank you for your answer!

    Even if you have already found the cause of the error, I put here some prints. Maybe it could help!

    And yes, Writers group have very limited permissions.

    Without your package

    Page that Wtriter create

    Options:

    Page

    Menu:

    enter image description here

    Page that another user create

    Options:

    enter image description here

    Menu:

    enter image description here

    With your package

    Page that another user create

    Options:

    enter image description here

    Menu:

    enter image description here

    Best regards!

    Ricardo Antunes

  • Nathan Woulfe 411 posts 1530 karma points MVP 3x c-trib
    Jun 20, 2018 @ 20:57
    Nathan Woulfe
    100

    Hi Ricardo - was exactly what I suspected. When the menu is less than five items, I add the workflow buttons to the end, otherwise I insert them at the fifth index in the menu. That's fine, unless the menu is exactly five items...

    There's an updated build available at https://ci.appveyor.com/project/nathanwoulfe/umbracoworkflow/build/artifacts, I haven't built a release just yet. If you replace the workflow.dll file in your bin folder, the issue will be resolved.

    N

  • Ricardo Antunes 3 posts 83 karma points
    Jun 21, 2018 @ 10:34
    Ricardo Antunes
    0

    Hi Nathan, I've replaced the dll, and yes, it works!

    Thank you again! :)

    Best regards, Ricardo Antunes

Please Sign in or register to post replies

Write your reply to:

Draft