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"
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.
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...
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
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.
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:
Menu:
Page that another user create
Options:
Menu:
With your package
Page that another user create
Options:
Menu:
Best regards!
Ricardo Antunes
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
Hi Nathan, I've replaced the dll, and yes, it works!
Thank you again! :)
Best regards, Ricardo Antunes
is working on a reply...