-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: NewsletterFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Regarding #19131.
I (again) tried it on 2.3-dev an the issue is not fixed in 2.3-dev.
Preconditions (*)
- latest Magento Version 2.3-dev
- Have at least two stores ( A and B)
Steps to reproduce (*)
- Register a user in A
- Subscribe to Newsletter in A
- Switch to Store B
- Subscribe to Newsletter again
Expected result (*)
- When in store B, Subscriber::loadByEmail() should work
2.SELECT store_id, customer_id FROM newsletter_subscribershould look like this:
+----------+-------------+
| store_id | customer_id |
+----------+-------------+
| 1 | 1 |
| 2 | 1 |
Actual result (*)
- When in store B, loadByEmail() (or loadById() ) cant find the subscriber since
SELECT store_id, customer_id FROM newsletter_subscriberlooks like this:
+----------+-------------+
| store_id | customer_id |
+----------+-------------+
| 1 | 1 |
| 1 | 1 |
What i think where the error is
In app/code/Magento/Newsletter/Model/Subscriber.php starting on line 468:
If the subscriber already exists with this email, the new entry gets the $customer->getStoreId()
not the $this->_storeManager->getStore()->getId()
If this is the intended behavior then loadByEmail() or loadByCustomerId() should be store_id agnostic.
Cheers!
Ben
Metadata
Metadata
Assignees
Labels
Component: NewsletterFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release