U4-6721 Error when submitting Macros, Collection was modified; enumeration operation may not execute. (after project has been updated to MVC5)

#U4-6721 In Progress
This commit is contained in:
Sebastiaan Janssen
2015-07-21 15:55:29 +02:00
parent 93c1321b99
commit 34f44b02a2
5 changed files with 44 additions and 18 deletions

View File

@@ -143,7 +143,7 @@ namespace Umbraco.Web.Macros
//bubble up the model state from the main view context to our custom controller.
//when merging we'll create a new dictionary, otherwise you might run into an enumeration error
// caused from ModelStateDictionary
controller.ModelState.Merge(new ModelStateDictionary(viewContext.ViewData.ModelState));
controller.ModelState.MergeSafe(new ModelStateDictionary(viewContext.ViewData.ModelState));
controller.ControllerContext = new ControllerContext(request, controller);
//call the action to render
var result = controller.Index();