Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
That is very strange. I suspect that it successfully removed all node-entry relations, but fails to commit other changes, so the entry still exists, but without any node-entry relations it would appear as direct child of catalog.
Is the exception the same if you delete the entry when it's still in the category (aka node)? I would guess it's the same
Yeah - same exception.
I don't know if it matters, but we're using a multi-warehouse implementation. Variants never have stock on more than one warehouse though.
Can you download this file https://www.dropbox.com/s/t6dsb86gnhvx0r4/Mediachase.Commerce.pdb?dl=0 , put it in bin, try to delete an entry and post the full exception stacktrace here?
Sure, here's the full stacktrace:
Value cannot be null. Parameter name: code
at Mediachase.Data.Provider.TransactionScope.ExecuteActions(IEnumerable`1 actions) at Mediachase.Data.Provider.TransactionScope.ThreadStaticTransactionScope.Commit() at Mediachase.Data.Provider.TransactionScope.Complete() at Mediachase.Commerce.InventoryService.Storage.InventoryDatabase.DeleteInventory(InventoryKeySet partialKeys) in D:\BuildAgent\work\3a59b0e2f981838\ECF\Mediachase.Commerce\InventoryService\Storage\InventoryDatabase.cs:line 210 at Mediachase.Commerce.InventoryService.Storage.InventoryCache.DeleteInventory(InventoryKeySet partialKeySet) in D:\BuildAgent\work\3a59b0e2f981838\ECF\Mediachase.Commerce\InventoryService\Storage\InventoryCache.cs:line 122 at Mediachase.Commerce.InventoryService.InventoryServiceProvider.DeleteByEntry(IEnumerable`1 catalogEntryCodes) in D:\BuildAgent\work\3a59b0e2f981838\ECF\Mediachase.Commerce\InventoryService\InventoryServiceProvider.cs:line 185 at Mediachase.Commerce.Catalog.Managers.CatalogEntryManager.DeleteCatalogEntry(IInventoryService inventoryService, Int32 entryId, Boolean recursive) in D:\BuildAgent\work\3a59b0e2f981838\ECF\Mediachase.Commerce\Catalog\Managers\CatalogEntryManager.cs:line 427 at Mediachase.Commerce.Catalog.Impl.CatalogContextImpl.DeleteCatalogEntry(Int32 entryId, Boolean recursive) in D:\BuildAgent\work\3a59b0e2f981838\ECF\Mediachase.Commerce\Catalog\Impl\CatalogContextImpl.cs:line 889 at EPiServer.Commerce.Catalog.Provider.Persistence.EntryContentBaseCommitter.Delete(ContentReference contentLink) at EPiServer.Commerce.Catalog.Provider.CatalogContentCommitterHandler.Delete(ContentReference contentLink) at EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.Delete(ContentReference contentLink, Boolean forceDelete) at EPiServer.Core.Internal.DefaultContentRepository.Delete(ContentReference contentLink, Boolean forceDelete, AccessLevel access) at EPiServer.Commerce.Shell.Controllers.DeleteController.Delete(IEnumerable`1 contentReferences) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) at EPiServer.Shell.Web.Mvc.ModuleMvcHandler.ProcessController(IController controller) at EPiServer.Shell.Web.Mvc.ModuleMvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I can't see anything obvious, do you have anything listen to CatalogKeyEventBroadcaster.InventoryUpdated?
We did indeed have a listener for InventoryUpdated, I never thought about this triggering when deleting a product! Adding a check to the event listner solved this.
Quan to the rescue again :)
We're having a problem with deleting products from the catalog through the EPiServer UI (not CM) just moves the product to the root of the catalog. Trying to delete it from the root causes an exception:
Value cannot be null. Parameter name: code
at Mediachase.Data.Provider.TransactionScope.ExecuteActions(IEnumerable`1 actions) at Mediachase.Data.Provider.TransactionScope.ThreadStaticTransactionScope.Commit() at Mediachase.Data.Provider.TransactionScope.Complete() at Mediachase.Commerce.InventoryService.Storage.InventoryDatabase.DeleteInventory(InventoryKeySet partialKeys)
All delete operations work from CM, but we would prefer to have it working in the EPiServer UI as well.
Using EPiServer.Commerce 11.8.1 and EPiServer CMS 11.3.2