Error when Updating Module

Topics: Customizing Orchard
Nov 6, 2014 at 10:53 PM
Hi, I get the following error when I try to install a module that was previously installed but has now been updated with new tables and content parts. I installed the Tekno.FlexSlider module but then decided to update it to allow the user to specify options for each slider (animation speed, etc). In order to do so I had to add a new table and a couple other things in the migration. When updating the module I changed the Migrations.cs file to include the new table and alter the parts as necessary. I then got everything working, deleted the Migrations.cs file and created a new one that did everything in the create function instead of having to use all the UpdateFrominteger functions, probably a bad idea as now I can install the updated module on any instance of orchard that hasn't previously had the Tekno.FlexSlider module installed, but if I try to install it on an instance of orchard that has had the Tekno.FlexSlider module installed previously it doesn't update the content parts or the database (at least I'm guessing it isn't since none of the new options are added in). I decided to try altering the Migrations.cs file to have an UpdateFrom2() function (since the original Tekno.FlexSlider uses UpdateFrom1() as the last function) in my UpdateFrom2 function I added in the table and altered the typedefinition for the FlexSliderGroup type to include the FlexSliderGroupPart which was newly added. When I install the module with the new Migrations.cs file it recognizes the module needs to be updated but then I get the following error when trying to update the module from within orchard.

Oops. Something went wrong ... sorry

An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
The parameters dictionary contains a null entry for parameter 'bulkAction' of non-nullable type 'Orchard.Modules.ViewModels.FeaturesBulkAction' for method 'System.Web.Mvc.ActionResult FeaturesPOST(Orchard.Modules.ViewModels.FeaturesBulkAction, System.Collections.Generic.IList1[System.String], System.Nullable1[System.Boolean])' in 'Orchard.Modules.Controllers.AdminController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters
System.ArgumentException: The parameters dictionary contains a null entry for parameter 'bulkAction' of non-nullable type 'Orchard.Modules.ViewModels.FeaturesBulkAction' for method 'System.Web.Mvc.ActionResult FeaturesPOST(Orchard.Modules.ViewModels.FeaturesBulkAction, System.Collections.Generic.IList1[System.String], System.Nullable1[System.Boolean])' in 'Orchard.Modules.Controllers.AdminController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters at System.Web.Mvc.ActionDescriptor.ExtractParameterFromDictionary(ParameterInfo parameterInfo, IDictionary2 parameters, MethodInfo methodInfo) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41()

Edit: as a side note when I was originally updating the module I was able to change the Migrations.cs file to UpdateFrom2() and include the new table and contenttype definitions in that function. I then just rebuilt the module and the new migrations took effect immediatly without needing to update the module from within orchard. Why is it making me update the module when I try to install the updated module?
Nov 6, 2014 at 11:23 PM
Edited Nov 6, 2014 at 11:24 PM
Sorry, I figured it out after looking at the logs. I had run an update database command after installing the updated module so it had all the right tables but it didn't execute the part of my Migrations.cs file that altered the FlexSliderGroup type to include the FlexSliderGroupPart. I just had to add an UpdateFrom2() function into my Migrations.cs file that altered the type definition for my FlexSliderGroup and now it works. The error was coming from the Migration.cs file trying to create the new table when it had already been created by the update database command.
Marked as answer by emeraldarcher on 11/6/2014 at 3:24 PM