-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Closed
Copy link
Labels
Fixed 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 passed
Description
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
Fixed 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 passed