Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Cloned instance of template breaks subshop compatibility #13

Open
mdjdev opened this issue Aug 16, 2022 · 2 comments
Open

Cloned instance of template breaks subshop compatibility #13

mdjdev opened this issue Aug 16, 2022 · 2 comments
Labels
kind/bug Something isn't working

Comments

@mdjdev
Copy link

mdjdev commented Aug 16, 2022

PHP Version

7.4

Shopware Version

5.7.11

Actual behaviour

Hi,

I'm refering to this commit: 1dcc559

Cloning the instance breaks the subshop compatibility in our shop. The result is really strange. See example below.

Assume a system with a freshly cleared cache. I make an order in our German shop and get a correct order mail. I than make an order in our Dutch shop and I get an order mail with sender, subject and footer from the German shop. If I make an order in any other subshop, I still get an order mail with sender, subject and footer from the German shop.

It will stay like this until I clear the cache again. I found out that it is enough to clear the template cache. After clearing the template cache, I get mails with sender, subject and footer from the shop, that is cached first.

What is the advantage here to clone the object? Is this compulsory? If I revert commit 1dcc559, than the mails are fine and I can't find any downsides. But I would prefer to find the reason why the cloned object is dependent on the template cache.

Additional info: I can reproduce this behaviour only on our AWS EC2 instances but not on our physical dev servers. I have no clue why the clone function and the template cache behave differently on these systems. I am grateful for any advice.

Thank you for feedback in advance.

Expected behaviour

Mails are always sent in the right context

Steps to Reproduce?

  • Update Shopware from 5.6.7 to 5.7.11
  • Update FroshTemplateMail from 1.0.0 to 1.1.2
  • Make orders in different subshops
@mdjdev mdjdev added the kind/bug Something isn't working label Aug 16, 2022
@larsbo
Copy link
Contributor

larsbo commented Aug 16, 2022

I observed that issue in 3 different shops with subshops, too. But I have no clue how that clone statement could produce such behavior. I thought about some kind of race condition as the reason for this bug 🤔

@mdjdev
Copy link
Author

mdjdev commented Aug 17, 2022

@larsbo I first thought it was due to the session management. I have no clue whats wrong with the clone statement either.

Could you please verify if removing the clone statement or clearing the template cache helps in your case, too?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants