Try our conversational search powered by Generative AI!

Login error converting anonymous cart with non-default name

Found in

EPiServer.Commerce 10.2.2

Fixed in

EPiServer.Commerce 10.2.3

(Or a related package)

Created

Jan 24, 2017

Updated

Feb 13, 2017

Area

Core

State

Closed, Fixed and tested


Description

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.