Skip to content

[Backport] Fix issue with unexpected changing of subscription status after customer saving #18642

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

Merged
merged 2 commits into from
Nov 22, 2018
Merged

[Backport] Fix issue with unexpected changing of subscription status after customer saving #18642

merged 2 commits into from
Nov 22, 2018

Conversation

arendarenko
Copy link
Contributor

@arendarenko arendarenko commented Oct 16, 2018

Original Pull Request

#18488

Description

If in some cases (for example: after migration data from M1) customer will have store_id = 0 and there are subscriber that related to this customer, after re-saving customer data, it might cause unexpected "unsubscribe" letter which would confuse customer experience.

My changes solves this problem because of adding additional checking storeId and if it's 0, getting it directly from the website.

Manual testing scenarios

  1. Create new customer
  2. Create customer
  3. Go to MySQL and set store_id = 0 in customer_entity table for this customer
  4. Go to MySQL and create record in newsletter_subscriber for this customer but with correct store_id and subscribe_status = 1.
  5. Go to backend -> Customers and open it for edit
  6. Change some customer data (for example, name) and save user

Expected result:
Nothing, except saving customer data, will happen

Actual result:
Customer will receive unsubscription letter.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @alexeya-ven. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

Update module logic when customer have store_id = 0
Fix unit tests according to new logic
Add integration tests for case when customer have store_id = 0
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-3276 has been created to process this Pull Request

@sidolov
Copy link
Contributor

sidolov commented Nov 9, 2018

Hi @alexeya-ven , unfortunately, we cannot reproduce described issue, maybe you can provide additional steps?
Thank you!

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Nov 9, 2018

Maybe it was fixed by #18643, but I don't think so

@magento-engcom-team magento-engcom-team merged commit 2a7e00f into magento:2.2-develop Nov 22, 2018
magento-engcom-team pushed a commit that referenced this pull request Nov 22, 2018
@magento-engcom-team
Copy link
Contributor

Hi @alexeya-ven. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants