Describe your bug or feature request.
Warning: Trying to access array offset on value of type null in Drupal\commerce_cart\Form\AddToCartForm->setFormDisplay() (line 206 of /home/mysite/public_html/modules/contrib/commerce/modules/cart/src/Form/AddToCartForm.php)
If a bug, provide steps to reproduce it from a clean install.
Believe this issue is related to PHP 7.4:
code at line 206:
if ($component['type'] === 'commerce_product_variation_attributes') {
modified code at line 206 and issue seems to be resolved:
if (isset($component['type']) && $component['type'] == 'commerce_product_variation_attributes') {
Not sure if this is the correct solution but "Trying to access array offset on value of type null" warnings are no longer displayed
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3274438.patch | 695 bytes | evaldas.uzkuras |
Comments
Comment #2
evaldas.uzkurasTo reproduce the issue you have to disable "Purchased entity" field for "Order item type's" form display mode "Add to cart".
Comment #4
jsacksick commentedCommitted, thank you for the fix!