Problem/Motivation
Using this module on a product variation with commerce stock field, when adding a product variation to the cart, I obtain the following fatal error:
AssertionError: Cannot load the "commerce_product_variation" entity with NULL ID. in assert() (line 261 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->load(NULL) (Line: 488)
Drupal\Core\Entity\EntityBase::load(NULL) (Line: 135)
commerce_stock_enforcement_add_to_cart_form_validate(Array, Object)
call_user_func_array('commerce_stock_enforcement_add_to_cart_form_validate', Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'commerce_order_item_variation_cart_form_form_commerce_product_variation_40') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('commerce_order_item_variation_cart_form_form_commerce_product_variation_40', Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('commerce_order_item_variation_cart_form_form_commerce_product_variation_40', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'variation_cart_form', Array) (Line: 93)
commerce_variation_cart_form_commerce_product_variation_view(Array, Object, Object, 'add_to_cart_form')
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'commerce_variation_cart_form') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('commerce_product_variation_view', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('commerce_product_variation_view', Array) (Line: 287)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 238)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
...
Proposed resolution
Determine a solution.
Remaining tasks