Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with CollectionEditorExtensions #83

Open
garetharevans opened this issue Feb 21, 2017 · 0 comments
Open

Issue with CollectionEditorExtensions #83

garetharevans opened this issue Feb 21, 2017 · 0 comments
Labels

Comments

@garetharevans
Copy link

Hello

There appears to be a bug in GetCollectionItemIndex in your CollectionEditorExtensions.

I found I was getting a newly created GUID after postback for the second item in the collection, after a server side validation failure. The symptom was that validation messages were not being displayed due to the ID in model state not matching the re-rendered id in the partial view. You appear to be adding previous indices into a different queue from the one passed to other views in HttpContext.

It seems that your code

previousIndices = new Queue<string>();
HttpContext.Current.Items[fieldKey] = new Queue<string>();

should actually be

previousIndices = new Queue<string>();
HttpContext.Current.Items[fieldKey] = previousIndices;

Thanks

@RicoSuter RicoSuter added the bug label Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants