WSOD when the quantity field is not present in the cart

Created on 14 August 2023, over 1 year ago
Updated 19 January 2024, 11 months ago

Problem/Motivation

We use a custom cart view that doesn't have a quantity field, and in this case commerce_stock_enforcement throws a PHP error at checkout when the item is out of stock:

TypeError: Drupal\Core\Form\FormState::setError(): Argument #1 ($element) must be of type array, null given, called in web/modules/contrib/commerce_stock/modules/enforcement/commerce_stock_enforcement.module on line 241 in Drupal\Core\Form\FormState->setError() (line 1118 of core/lib/Drupal/Core/Form/FormState.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States wxactly

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

Comments & Activities

Production build 0.71.5 2024