-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Wrong store_id assigned to Customer when reading his subscription to Newsletter #13469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hello @Nil79. Thank you for your contribution. |
@@ -360,7 +360,6 @@ public function loadByCustomerId($customerId) | |||
{ | |||
try { | |||
$customerData = $this->customerRepository->getById($customerId); | |||
$customerData->setStoreId($this->_storeManager->getStore()->getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot simply remove the store_id check since it brings problems with multistore subscriptions. Details are here: #10014
Hello @rogyar , Thanks for the feedback, I'm testing the frontend in a multisite scenario and it seems that this commit doesn't affect the frontend newsletter subscription, because the function loadByCustomerId also loads the customer for the right storeId before the line "$customerData->setStoreId($this->_storeManager->getStore()->getId());" is called. But to be sure that I'm doing the right tests on frontend (and before make changes to solve the issue on backend) l I've contacted the author of the pull request #12035, to get more feedbacks. Regards, |
Hello @Nil79. Any update regarding this issue? Thanks |
5b461aa
to
999f439
Compare
Hello @rogyar , I have contacted the author of the pull request #12035, to get more clarifications about the changes in the file Subscriber.php, but I didn't receive any reply. I have just made some tests, verifying that in a multisite scenario, removing the following line of code doesn't affects the issue:
I don't know if to wait again for the reply or just apply a little code change to skip this line of code when the user is in the Admin area (but also removing it definitively doesn't affect the issue as I have said) Regards. |
Hi @Nil79 , I am closing this PR now due to inactivity. |
Description
The issue comes in a scenario with multiple stores.
When we edit an existing customer that was previously subscribed in newsletter from backend, magento assigns to him store_id 1 also if he was created from another store (e.g store 2).
From the manage Customer page, In the Newsletter panel tab, the label "Last Date Unsubscribed" with the date of last subscription of the user, does not appear.
If we try to subscribe again the customer into newsletter (always from Customer page), Magento will create a duplicated entry in the database table "newsletter_subscriber"
Fixed Issues (if relevant)
N/A
Manual testing scenarios
Contribution checklist