coreshop / CoreShop

CoreShop - Pimcore enhanced eCommerce
http://www.coreshop.org
Other
277 stars 157 forks source link

Store Context in Messenger Queue Missing #2726

Closed solverat closed 1 month ago

solverat commented 1 month ago
Q A
Bug report? maybe
Feature request? no
BC Break report? no
RFC? no

Given:

Using the context within the order confirmation mail template will rise an StoreNotFoundException.

Reason: When starting messenger:consume coreshop_notification, the CachedStoreContext instantly gets triggered ⇾ no store could be found ⇾ initialized will be set to true ⇾ never gets checked again in incoming messages.

However, this worked before https://github.com/coreshop/CoreShop/pull/2562, because of the cachedStore === null check.

Since the messenger may not provide a request, this is correct anyway, but to provide a store within the messenger context? Currently, i just created custom store resolver with a low priority which loads the default store.

dpfaffenbauer commented 1 month ago

@solverat https://github.com/coreshop/CoreShop/pull/2727 should fix it. But usually, in a Mail, you should not rely on the StoreContext. You should rather use the Store assigned to the Order.