Cannot load the "commerce_product_variation" entity with NULL ID

Created on 31 August 2023, about 1 year ago
Updated 25 September 2023, about 1 year ago

Problem/Motivation

AssertionError: Cannot load the "commerce_product_variation" entity with NULL ID. in assert() (line 244 of D:\Projects\antiqa\web\core\lib\Drupal\Core\Entity\EntityStorageBase.php).
and line that trying to load the entity is in line 135 commerce_stock\modules\enforcement\commerce_stock_enforcement.module.

Steps to reproduce

when use ajax add to cart form with commerce_variation_cart_form and commerce_stock_enforcement, so install commerce_variation_cart_form, ajax_add_to_cart, commerce_stock_enforcement modules and try the ajax add to cart feature.

Proposed resolution

a patch to resolve the purchased entity from form entity if not set in form state values.

Remaining tasks

community to review patch.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇬Egypt Mohamed Nabawy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024