{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/19172","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/19172/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/19172/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/19172/events","html_url":"https://github.com/magento/magento2/issues/19172","id":379798459,"node_id":"MDU6SXNzdWUzNzk3OTg0NTk=","number":19172,"title":"Newsletter subscription does not set the correct store_id if already subscribed.  Not Fixed in 2.3-dev","user":{"login":"bbmxxc","id":43030954,"node_id":"MDQ6VXNlcjQzMDMwOTU0","avatar_url":"https://avatars3.githubusercontent.com/u/43030954?v=4","gravatar_id":"","url":"https://api.github.com/users/bbmxxc","html_url":"https://github.com/bbmxxc","followers_url":"https://api.github.com/users/bbmxxc/followers","following_url":"https://api.github.com/users/bbmxxc/following{/other_user}","gists_url":"https://api.github.com/users/bbmxxc/gists{/gist_id}","starred_url":"https://api.github.com/users/bbmxxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbmxxc/subscriptions","organizations_url":"https://api.github.com/users/bbmxxc/orgs","repos_url":"https://api.github.com/users/bbmxxc/repos","events_url":"https://api.github.com/users/bbmxxc/events{/privacy}","received_events_url":"https://api.github.com/users/bbmxxc/received_events","type":"User","site_admin":false},"labels":[{"id":688811200,"node_id":"MDU6TGFiZWw2ODg4MTEyMDA=","url":"https://api.github.com/repos/magento/magento2/labels/Issue:%20Format%20is%20valid","name":"Issue: Format is valid","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-12T14:21:26Z","updated_at":"2018-11-12T14:33:14Z","closed_at":null,"author_association":"NONE","body":"Regarding https://github.com/magento/magento2/issues/19131.\r\nI (again) tried it on 2.3-dev an the issue is *not* fixed in 2.3-dev.\r\n\r\n\r\n<!---\r\nPlease review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines\r\nFields marked with (*) are required. Please don't remove the template.\r\n-->\r\n\r\n### Preconditions (*)\r\n<!---\r\nProvide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.\r\n-->\r\n1. latest Magento Version 2.3-dev\r\n2. Have at least two stores ( A and B)\r\n### Steps to reproduce (*)\r\n<!---\r\nImportant: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.\r\n-->\r\n1. Register a user in  A\r\n2. Subscribe to Newsletter in A \r\n3. Switch to Store B\r\n4. Subscribe to Newsletter again\r\n\r\n\r\n### Expected result (*)\r\n<!--- Tell us what do you expect to happen. -->\r\n1. When in store B, Subscriber::loadByEmail() should work\r\n2.` SELECT store_id, customer_id FROM newsletter_subscriber` should look like this:\r\n\r\n```\r\n+----------+-------------+\r\n| store_id | customer_id |\r\n+----------+-------------+\r\n|        1 |           1 |\r\n|        2 |           1 |\r\n```\r\n \r\n\r\n### Actual result (*)\r\n<!--- Tell us what happened instead. Include error messages and issues. -->\r\n1. When in store B, loadByEmail() (or loadById() ) cant find the subscriber since\r\n2. `SELECT store_id, customer_id FROM newsletter_subscriber` looks like this:\r\n```\r\n+----------+-------------+\r\n| store_id | customer_id |\r\n+----------+-------------+\r\n|        1 |           1 |\r\n|        1 |           1 |\r\n\r\n```\r\n\r\n### What i think where the error is\r\nIn `app/code/Magento/Newsletter/Model/Subscriber.php` starting on line [468](https://github.com/magento/magento2/blob/6481cecaa9ea6959ebb255b4271f88d746ebb21b/app/code/Magento/Newsletter/Model/Subscriber.php#L468): \r\nIf the subscriber already exists with this email, the new entry gets the `$customer->getStoreId()`\r\nnot the `$this->_storeManager->getStore()->getId()`\r\n\r\nIf this is the intended behavior then `loadByEmail()` or `loadByCustomerId()` should be store_id agnostic.\r\n\r\nCheers!\r\nBen"},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/437902591","html_url":"https://github.com/magento/magento2/issues/19172#issuecomment-437902591","issue_url":"https://api.github.com/repos/magento/magento2/issues/19172","id":437902591,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzkwMjU5MQ==","user":{"login":"bbmxxc","id":43030954,"node_id":"MDQ6VXNlcjQzMDMwOTU0","avatar_url":"https://avatars3.githubusercontent.com/u/43030954?v=4","gravatar_id":"","url":"https://api.github.com/users/bbmxxc","html_url":"https://github.com/bbmxxc","followers_url":"https://api.github.com/users/bbmxxc/followers","following_url":"https://api.github.com/users/bbmxxc/following{/other_user}","gists_url":"https://api.github.com/users/bbmxxc/gists{/gist_id}","starred_url":"https://api.github.com/users/bbmxxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbmxxc/subscriptions","organizations_url":"https://api.github.com/users/bbmxxc/orgs","repos_url":"https://api.github.com/users/bbmxxc/repos","events_url":"https://api.github.com/users/bbmxxc/events{/privacy}","received_events_url":"https://api.github.com/users/bbmxxc/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T14:33:14Z","updated_at":"2018-11-12T14:33:14Z","author_association":"NONE","body":"Hi! Thanks for the fast reply. But this are all different users. Try registering an user in one store and subscribing to the newsletter in a different one."}}
{"actor":{"display_login":"bbmxxc"}}