Skip to content

StoreManager returns admin store by default while creating customer and resetting password #15664

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

Closed
tizzyguy87 opened this issue Jun 1, 2018 · 6 comments
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@tizzyguy87
Copy link

tizzyguy87 commented Jun 1, 2018

Preconditions

  1. Initially used Magento 2.2.0 CE
  2. Upgraded to Magento 2.2.4 CE
  3. PHP version 7

Steps to reproduce

  1. Upgraded to Magento version 2.2.4 from 2.2.0
  2. Created customer from admin console
  3. Triggered reset password for newly created customer
  4. Customer receives email.
  5. When tries to set password with reset link, getting below response from reset password API -
{"message":"No such entity with %fieldName = %fieldValue, %field2Name = %field2Value","parameters":{"fieldName":"email","fieldValue":"[email protected]","field2Name":"websiteId","field2Value":"0"}}

Expected result

  1. Customer should be able to reset password

Actual result

  1. Getting response from reset password API as below
{"message":"No such entity with %fieldName = %fieldValue, %field2Name = %field2Value","parameters":{"fieldName":"email","fieldValue":"[email protected]","field2Name":"websiteId","field2Value":"0"}}
  1. Admin store id and websiteId (which is 0) are used instead of Default store and it's id (which is 1)

Please note below details :

  1. customer_entity has store_id as 1 for customers
  2. retrieveByEmail method in CustomerRegistry.php has logic to get store from storemanager. This is returning 0 which is admin store but I need default store
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Jun 1, 2018
@tizzyguy87
Copy link
Author

tizzyguy87 commented Jun 7, 2018

Hi Magento team,

Can you please give ETA for this issue? This is blocker for us. Please suggest if there is any workaround till we get actual fix.

@tizzyguy87
Copy link
Author

tizzyguy87 commented Jul 18, 2018

Team,

I found this issue in Magento 2.2.5 as well. Am I supposed to do anything to set my store as default store?

It was working perfectly fine in Magento 2.2.0. But not working in 2.2.4 and 2.2.5 as well.

@ghost ghost self-assigned this Jul 19, 2018
@ghost
Copy link

ghost commented Jul 19, 2018

@ tizzyguy87, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation.

@tizzyguy87
Copy link
Author

  1. Install Magento 2.2.0
  2. Use default store. No need of multiple stores.
  3. Import Products, create customers.
  4. Create customers from admin console, trigger welcome mail and password reset mails.
  5. Reset password from link given in email. Login using new password. Login works perfectly.
  6. Place couple of orders.
  7. Store is set as default store for customers, orders.
  8. order sequence number is incremented in sequence_order_1
  9. Upgrade Magento to 2.2.5 from Setup Wizard
  10. Fix all the issues during migration.
  11. Try to login with old customers. For new customers try to reset password.
  12. Login not working. Password reset also not working. This is because magento returns store id as 0 instead of 1. So customer is not found for that email in storeid = 0
  13. Did workaround to continue with login. In CustomerRegistry.php, retrieveByEmail method has logic to get websiteid. hard coded this to 1. Hence I am able to continue with login for existing customers.
  14. Continue to add products to cart and place orders.
  15. Order placed successfully with store id=0

@tizzyguy87
Copy link
Author

tizzyguy87 commented Jul 20, 2018

#16953 is created for the same. I will close any one based on your inputs.

@ghost
Copy link

ghost commented Jul 23, 2018

@tizzyguy87, closing this as a duplicate.

@ghost ghost closed this as completed Jul 23, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

2 participants