This was reproduced using Commerce Manager add-to-cart instead of using the Commerce sample site front-end (I couldn't reproduce using checkout on the front-end)
System.ArgumentNullException: Value cannot be null.
Parameter name: request
at Mediachase.Commerce.InventoryService.InventoryServiceProvider.Request(InventoryRequest request)
at Mediachase.Commerce.Workflow.Activities.Cart.AdjustInventoryActivity.RequestInventory(OrderForm orderForm, Shipment shipment, LineItem lineItem)
at Mediachase.Commerce.Workflow.Activities.Cart.AdjustInventoryActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run()
System.ArgumentNullException: Value cannot be null.
Parameter name: request
at Mediachase.Commerce.InventoryService.InventoryServiceProvider.Request(InventoryRequest request)
at Mediachase.Commerce.Workflow.Activities.Cart.AdjustInventoryActivity.RequestInventory(OrderForm orderForm, Shipment shipment, LineItem lineItem)
at Mediachase.Commerce.Workflow.Activities.Cart.AdjustInventoryActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run()
You should be able set a sku to disabled inventory, so this is likely a bug. This issue seems due to the code in AdjustInventoryActivity for RequestInventory() method (reflecting NuGet Mediachase.Commerce.Workflow.dll).
RequestInventory() seems to be different in the source code version found in World, which is:
private void RequestInventory(OrderForm orderForm, Shipment shipment, LineItem lineItem)
{
var lineItemIndex = orderForm.LineItems.IndexOf(lineItem);
var request = AdjustStockItemQuantity(shipment, lineItem);
if (request != null)
{
InventoryResponse response = _inventoryService.Service.Request(request);
if (response.IsSuccess)
{
lineItem.IsInventoryAllocated = true;
// Store operation keys to Shipment for each line item, to use later for complete request
var existedIndex = shipment.OperationKeysMap.ContainsKey(lineItemIndex);
var operationKeys = response.Items.Select(c => c.OperationKey);
if (!existedIndex)
{
shipment.AddInventoryOperationKey(lineItemIndex, operationKeys);
}
else
{
shipment.InsertOperationKeys(lineItemIndex, operationKeys);
}
}
}
}
Expected: Able to purchase skus with inventory disabled (examples included digital downloads which have no physical inventory)
Actual: Workflow error