Closed
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_subscriber
should 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_subscriber
looks 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
The issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release