Add to cart form fails if the site defines multiple Store entities

Created on 9 October 2023, about 1 year ago

Problem/Motivation

If the site only has a default Store entity all works fine but as soon as there are multiple Store entities and the current one is resolved dynamically (via commerce_store.current_store) then we experience WSOD

Steps to reproduce

Create a Store, Product, and Variation. Enable this module. Go to the Product page and observe how all works fine. Now add an additional Store and enable it for the Product. Go to the Product page and watch how it fails.

Proposed resolution

The module utilizes SelectStoreTrait but does not initialize the $currentStore member variable.

Remaining tasks

Initialize $currentStore with commerce_store.current_store, preferably via DI.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇳🇴Norway zaporylie

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

Comments & Activities

Production build 0.71.5 2024