Module break commerce widgets

Created on 7 August 2025, 18 days ago

Problem/Motivation

When using commerce, i cannot edit some variation widgets in commerce order item anymore.

D11.2.2
Commerce 3.1.0

Steps to reproduce

  • Enable Commerce and Commerce order modules.
  • Set default order and order item if it doesn't exist yet
  • Go to /admin/commerce/config/order-item-types/default/edit/form-display/add_to_cart
  • Set "Purchased entity" widget to "Product variation title" and edit widget.

See error in console :

TypeError: Drupal\commerce_product\Plugin\Field\FieldWidget\ProductVariationWidgetBase::loadEnabledVariations(): Argument #1 ($product) must be of type Drupal\commerce_product\Entity\ProductInterface, null given, called in /var/www/html/web/modules/contrib/commerce/modules/product/src/Plugin/Field/FieldWidget/ProductVariationAttributesWidget.php on line 97 in Drupal\commerce_product\Plugin\Field\FieldWidget\ProductVariationWidgetBase->loadEnabledVariations() (line 171 of modules/contrib/commerce/modules/product/src/Plugin/Field/FieldWidget/ProductVariationWidgetBase.php). 
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France goz

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

Comments & Activities

Production build 0.71.5 2024