Jan 24, 2017
Feb 13, 2017
Core
Closed, Fixed and tested
Steps to reproduce:
1. Login and add an item to the cart.
2. Logout and add a different item to the cart.
3. Change the OrderForm.Name value for one of the carts and login (Was changed directly in the DB when reproducing UPDATE OrderForm Set Name='NewCart' WHERE OrderFormId=17)
Expected: User logs in successfully, cart is transferred to logged-in user.
Actual: Exception:
EPiServer.Business.Commerce.HttpModules.ProfileModule.Profile_MigrateAnonymous
Stacktrace:
[InvalidOperationException: Collection was modified; enumeration operation may not execute.]
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +56
System.Collections.Generic.Enumerator.MoveNextRare() +13812650
EPiServer.Commerce.Order.Internal.CartMigrator.MergeForms(ICart sourceCart, ICart destinationCart) +706
EPiServer.Commerce.Order.Internal.CartMigrator.MigrateCarts(Guid sourceCustomerId, Guid destinationCustomerId) +558
EPiServer.Business.Commerce.HttpModules.ProfileModule.MigrateCarts(CustomerContact contact, String anonymousId) +310
EPiServer.Business.Commerce.HttpModules.ProfileModule.Profile_MigrateAnonymous(Object sender, ProfileMigrateEventArgs pe) +593
System.Web.Profile.ProfileModule.OnEnter(Object source, EventArgs eventArgs) +239
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0
The error seems to be related to orderforms with different names.